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 happens when I use / and % with a negative numerator?
Can private class be inherited in java?
Can each java object keep track of all the threads that want to exclusively access it?
How many bits is a float?
Explain the use of volatile field modifier?
What is the difference between static binding and dynamic binding?
What does void * mean?
Explain the difference between extends thread vs implements runnable in java?
What is a constructor overloading in java?
What is garbage collection? What is the process that is responsible for doing that in java?
What string is utf8?
Find the value of a specified element of the array arr[i] where 0 <= i <= n-1
What are the Main functions of Java?
What is immutable class in java?
Write a program to find the greatest of three numbers in java?