如何打印字符串而不将其放在双引号内

时间:2017-04-10 19:57:13

标签: java

需要在不使用双引号的情况下打印此字符串。

 Class Test{
 public static void main(String args[]){

 //print "I am khushi" but it should not be printed like 
 //System.out.println("I am khushi");

 }
 }

2 个答案:

答案 0 :(得分:5)

System.out.println(\u0022I am khushi\u0022);

答案 1 :(得分:3)

此?

public static void main(String[] args) {
    char[] msg = new char[]{73, 32, 97, 109, 32, 107, 104, 117, 115, 104, 105};
    System.out.println(String.valueOf(msg));
}