zyamat
zyamat

Reputation: 8491

Printing "special" characters with java

I want to println

System.out.println("*_data<*>" text;");

as *_data<*> text; and also write this to a file. I can't even get it to write to console because of errors...

Upvotes: 0

Views: 5035

Answers (2)

&#252;berjesus
&#252;berjesus

Reputation: 824

simply try:

System.out.println("*_data<*>\" text;"); 

Upvotes: 1

Belinda
Belinda

Reputation: 1231

You have a " after <*>. That is causing the error. If you want to print the literal text remove the ". If not replace that quote with a + sign and remove the last quote.

Upvotes: 2

Related Questions