Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

System.out.println problem  RSS feed

 
mantai sethobja
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I wanted to print something like "dah!!", but System.out.println does not want to print inverted commas, it gives me an error.
 
ahmed yehia
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to use \" escape character, you can do something like:
 
K. Tsang
Bartender
Posts: 3633
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mantai sethobja:
HI,

I wanted to print something like "dah!!", but System.out.println does not want to print inverted commas, it gives me an error.


One easy way to do this is to add '"' in front and end of the println statement. And I don't think quotes can't be displayed as inverted commas in the console, unlike inside MS Word.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!