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
What is generic type?
Which browsers work with java?
Explain about the select method with an example?
What’s the difference between callable and runnable?
What is runtime polymorphism or dynamic method dispatch?
What is the difference between the direct buffer and non-direct buffer in java?
What is java in simple terms?
Differentiate between a class and an object.
Differentiate between the constructors and methods in java?
What is a top level class in java?
What is the equal sign?
What is the difference between multiple processes and multiple threads?
What is the difference between an interface and an abstract class?
What is the right data type to represent a price in java?
When can an object reference be cast to an interface reference in java programming?