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 / 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

what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent

2190


Can we overload the main() method?

1052


What is class forname?

1035


What is integer size in java?

1040


What is the difference between throw and throws in java?

1113


What is the difference between a constructor and a method?

1267


What java is used for?

1081


Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?

1106


What are thread safe functions?

960


Why scanner is used in java?

1087


Is string pool garbage collected?

1023


What is the difference between a field variable and a local variable?

1123


What is tostring () method?

1039


Is it possible to override the main method?

989


Can we call a non-static method from inside a static method?

1005