File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not getting converted to string

 
Karthikeyan Pandian
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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
Posts: 158
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 12021
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is hte output:

C:\>java Iron
c
9
48
90
3.14
3.14
3.14
fe
 
Karthikeyan Pandian
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 242
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Matthew Brown, you are right. It is convention because result coming same so writer of the book differentiate the result mentioning there quotes("").
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic