int a=1;
float b=1.0;
System.out.println(a==b);
Answer Posted / ranga reddy
int a = 1;
float b = 1.0;
System.out.println(a==b);
if we declare float b = 1.o; by default it takes double value, then it will give compile time error as possiblelossofpression
then we declare as float b = 1.0f;
at this time System.out.println(a==b); gives
true
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What are the different conditional statements?
Does every java program need a main?
How many bytes is a char in java?
Can a main method be declared final?
How can an object be unreferenced?
Why char array is favored over string for the storage of passwords?
When arithmeticexception is thrown?
How do constructors use this() and super()?
How do you sort arrays in java?
What is use of arraylist in java?
Can we have two methods in a class with the same name?
Which is faster call by value or call by reference?
What is singleton class and how can we make a class singleton?
What is the finalize method do?
Why hashset is used in java?