aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes not getting converted to string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "not getting converted to string" Watch "not getting converted to string" New topic
Author

not getting converted to string

Karthikeyan Pandian
Ranch Hand

Joined: Jun 09, 2013
Posts: 66



In 18 th line the double is not getting converted to string, its givng the same value with quotations. please tell the misake there. Thank you
James X Peterson
Whizlabs Java Support
Ranch Hand

Joined: Feb 26, 2013
Posts: 158
Karthikeyan Pandian wrote:


In 18 th line the double is not getting converted to string, its givng the same value with quotations. please tell the misake there. Thank you



The output will not be in double quotes. The output will be 3.14 .
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11311
    
  16

Here is hte output:

C:\>java Iron
c
9
48
90
3.14
3.14
3.14
fe

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Karthikeyan Pandian
Ranch Hand

Joined: Jun 09, 2013
Posts: 66
But in K & B book , the output is enclosed within the quotes.. In page no 242 (Chapter Assignments).. Please sort me out the query..
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4387
    
    8

I think that's just a convention to indicate it's printing a String value rather than a numeric value. The output is as you see.
Thakur Sachin Singh
Ranch Hand

Joined: Jun 15, 2010
Posts: 232

Yes Matthew Brown, you are right. It is convention because result coming same so writer of the book differentiate the result mentioning there quotes("").


SCJP 6- 91%, IBM DB2, IBM RAD Certified
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not getting converted to string