📄 lx3_22.java
字号:
//lx3_22.java
public class lx3_22{
public static void main(String args[]) {
char chars1[] = {'a', 'b', 'c'};
char chars2[] = {'a', 'b', 'c', 'd'};
String s1 = new String();
System.out.println("s1:" + s1);
String s2 = new String(chars1);
System.out.println("s2:" + s2);
String s3 = new String(chars2, 1, 3);
System.out.println("s3:" + s3);
byte bytes[] = {99, 100, 101}; //使用ASCII码生成字符
String s4 = new String(bytes);
System.out.println("s4:" + s4);
String s5 = new String("中国");
System.out.println("s5:" + s5);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -