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 advantage do java's layout managers provide over traditional windowing systems?

961


Is sizeof a preprocessor?

1013


What is unicode with example?

1224


Explain different types of wrapper classes in java?

1032


Explain enumeration in java?

1015


Can you use this() and super() both in a constructor?

988


What is java Applet?

1113


What is method overriding in java ?

1199


What is meant by interface?

1065


How variables are declared?

985


What do you mean by hashing?

1118


What are the 4 versions of java?

1173


Explain the scope of a variable.

1103


What is the difference between state-based unit testing and interaction-based unit testing?

944


how are methods defined?

1065