开发者

Printing "special" characters with java

开发者 https://www.devze.com 2023-02-17 07:18 出处:网络
I want to println System.out.println("*_data<*>" text;"); as *_data<*> text; and also write this to a file. I can\'t even 开发者_如何学Cget it to write to console because o

I want to println

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

as *_data<*> text; and also write this to a file. I can't even 开发者_如何学Cget it to write to console because of errors...


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.


simply try:

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

精彩评论

暂无评论...
验证码 换一张
取 消