Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

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

1040


Explain about static imports in java?

999


What is difference between calling start() and run() method of thread?

1134


What do you understand by access specifiers in Java?

1015


What are the differences between Java 1.0 and Java 2.0?

2280


What is the purpose class.forname method?

964


Can we have more than one package statement in the source file?

1060


What is the advantage of preparedstatement over statement?

1113


What is sortedmap in java?

1036


Name the components that are termed to be Heavy-weight component but available in Light-weight components?

2491


What is a map in java?

995


What does indexof mean?

1030


Is 0 true or false in java?

988


What is use of super keyword?

968


Do I need to import java.lang package any time? Why?

1390