int a=1;
float b=1.0;
System.out.println(a==b);
Answer Posted / aruna
this code will not compile since 1.0 will be taken as a
double instead of float, To make this code work, the
following changes shud b done
float b=1.0f;
or double = 1.0;
with these changes the SOP statement will print "true"
| Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
Write a java program to check if a number is prime or not?
Explain about static imports in java?
What is difference between calling start() and run() method of thread?
What do you understand by access specifiers in Java?
What are the differences between Java 1.0 and Java 2.0?
What is the purpose class.forname method?
Can we have more than one package statement in the source file?
What is the advantage of preparedstatement over statement?
What is sortedmap in java?
Name the components that are termed to be Heavy-weight component but available in Light-weight components?
What is a map in java?
What does indexof mean?
Is 0 true or false in java?
What is use of super keyword?
Do I need to import java.lang package any time? Why?