• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing a boolean with double quotes  RSS feed

 
Tom Zanoli
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I started a basic java class and I cannot figure out how to print double quotes around the boolean variable in the code below. Any help would be appreciated.
I want the output to look like this: I can get everything except the double quotes. I know you need to use \" somehow but I cannot figure it out. Thanks...
'CategoryA' = "false"
'CategoryB' = "true"
'CategoryC' = "false"


 
Sathi Krishna
Ranch Hand
Posts: 51
Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try with the below statement
 
Tom Zanoli
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sathi Krishna wrote:Try with the below statement


That worked. Thanks a lot
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This would have been better:you should use %n not \n because that will find the correct line end for your operating system.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!