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

What is compiler and what its output.

1075


What is rmi and steps involved in developing an rmi object?

988


Is it possible for yielded thread to get chance for its execution again ?

962


What is a conditional equation?

967


What is a vector in java?

971


How does singleton class work?

924


What are the new features in java 8?

974


What is the use of default method in interface in java? Explain

928


What is the intersection and union methods?

976


How do you add an element to a set in java?

974


Which container method is used to cause a container to be laid out and redisplayed in java programming?

1049


Why java is secure? Explain.

966


What are design patterns and please explain?

1029


Can we override private methods?

966


What is literal example?

899