Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System.out.println problem

 
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: 3348
12
Android Java
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic