Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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

Why is multithreading important?

162


What is the difference between Java and C++?

238


Define how objects are stored in java?

210


What is the full form of jpeg?

181


What is mean by exception?

199






What is off heap memory?

165


Describe method overriding

208


Is map sorted in java?

203


How many static init can you have?

218


What is a platform?

206


Can we pass null as argument in java?

168


Write a program to print all permutations of string?

223


What is method reference?

177


Can you call one constructor from another if a class has multiple constructors?

218


What are synchronized methods ?

239