日期:2014-05-20  浏览次数:20720 次

帮我看看这两句有错误吗?
14 String wiringComment = new String("Comment" + "ない");
15 String wiringCommentJapanese = new String(wiringComment.getBytes(), "utf-8");
16 System.out.println(wiringCommentJapanese );

提示14行 String literal is not properly closed by a double-quote

写日文就这样,为什么啊?

------解决方案--------------------
Java code

         String wiringComment = new String("Comment" + "ない");
         String wiringCommentJapanese = new String(wiringComment.getBytes(), "utf-8");
         System.out.println(wiringCommentJapanese )

------解决方案--------------------
翻译过来是双引号字符串是不正确关闭 顶楼上看双引号
------解决方案--------------------
双引号确定是英文的话,试试将源代码文件转为uft-8或日文编码
------解决方案--------------------
探讨
双引号没有问题啊,难道跟操作系统有关系。

------解决方案--------------------
确认下文件编码格式是否支持日文。
------解决方案--------------------
String wiringComment = new String("Comment" + "ない");
String wiringCommentJapanese = new String(wiringComment.getBytes(), "utf-8");
System.out.println(wiringCommentJapanese ) ;

是不是 14中由中文" 啊 ?
------解决方案--------------------
应该是编码问题

没用过日文,帮顶一下