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

hi,
toString() method will also not work here.

double d=10.5;
String str= d.toString();

E:\Programs>javac conversionTest.java
conversionTest.java:6: double cannot be dereferenced
String str= d.toString();
^
1 error


The only way I found is as below and is working fine.

double d=10.5;
String str= ""+d+"";
System.out.println(str);

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Implementations of set interface?

991


Which is better ascii or unicode?

982


Is main an identifier?

994


How to create a custom exception?

970


What does @param args mean in java?

1040


How many types of memory areas are allocated by JVM in java?

1057


What is difference between fileinputstream and filereader in java?

1047


How do you achieve polymorphism in java?

983


What is an off by one error in java?

943


Is java se open source?

1009


How can I debug the Java security exceptions and AccessControlExceptions?

1134


what is meant by HQL?

1045


Does java allow default arguments?

974


Explain the available thread states in a high-level?

946


What do you mean by mnemonics?

1029