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

What happens when you assigned a 'double' value to
a 'String'?

Answer Posted / cleon

@Pankaj:
What are you trying to do?, trying to call a function from
primitive type/reference, that that will never work. You can
call function on Object types.

Double d = 5.5D; //D is optional as by default it is treated
to be double value
String s = d.toString();

If one tries to do something like
String s = 5.5;
A type mismatch errors will be shown during compilation itself!!

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we declare array without size in java?

1082


Is 0 true or is 1 true?

1004


What is the file type?

1068


What is an example of a keyword?

1165


Why is inheritance used in java?

1175


What are the elements of java?

1065


What is lazy initialization in java?

1058


Can arraylist hold different types java?

1038


What is a superclass?

1407


What is difference between c++ and java ?

1167


Why do we need wrapper classes?

1118


Difference between vector and arraylist.

1183


describe synchronization in respect to multithreading? : Java thread

974


What is a locale?

1216


Is static variable stored in heap?

1051