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

What is generic type?

1020


Which browsers work with java?

1071


Explain about the select method with an example?

1176


What’s the difference between callable and runnable?

1098


What is runtime polymorphism or dynamic method dispatch?

1004


What is the difference between the direct buffer and non-direct buffer in java?

1030


What is java in simple terms?

996


Differentiate between a class and an object.

1029


Differentiate between the constructors and methods in java?

942


What is a top level class in java?

1021


What is the equal sign?

1117


What is the difference between multiple processes and multiple threads?

1200


What is the difference between an interface and an abstract class?

1001


What is the right data type to represent a price in java?

954


When can an object reference be cast to an interface reference in java programming?

1018