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
When does an object becomes eligible for garbage collection in java?
What do you understand by garbage collection in Java? Can it be forced to run?
What is stored procedure. How do you create stored procedure ?
In the below example, how many string objects are created?
What is use of arraylist in java?
Difference between start() and run() method of thread class?
What is method reference?
What is the difference between length and length() method in java?
Why multiple inheritance is not supported by java?
How to declare an arraylist in java?
Can we return null in java?
What is an example of a constant variable?
How do you check if two given string are anagrams?
Explain the importance of finally block in java?
Can we sort a map in java?