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

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

1395


What do you understand by weak reference?

1017


What is the difference between pass by reference and pass by pointer?

1109


Which arithmetic operations can result in the throwing of an arithmeticexception?

1027


what is comparable and comparator interface?

999


How do you implement polymorphism in our day to day life?

3235


Can list be null in java?

1044


Can we extend private class in java?

990


Is main a function?

1062


Where local and global variables are stored?

1086


Is singleton class thread safe?

1003


What is the purpose of abstract class?

1018


Is sizeof a keyword in java programming?

1070


What is the difference between JDK and JVM?

1274


When is an object subject to garbage collection?

1081