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


Please Help Members By Posting Answers For Below Questions

Why is a singleton bad?

552


What is boolean used for?

585


What are the features of java?

528


What is the difference between reader/writer and inputstream/output stream?

551


How to convert string to char and vice versa?

513






Can a constructor call another constructor?

559


What is flush () in java?

553


Is the milky way in a void?

538


What are the different types of inheritance in java?

526


What are the disadvantages of object oriented programming?

587


What is the relationship difference the canvas class and the graphics class?

560


What is the main function in java?

526


What is complexity and its types?

520


What are the different approaches to implement a function to generate a random number?

564


Write a java program to check if a number is prime or not?

533