一.输入字符串数据
import java.util.Scanner;
public class kkb {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String line = sc.nextLine();
System.out.println(line);
}
}
二.String
三.String的构造方法
public class kkb {
public static void main(String[] args) {
String s1=new String();
System.out.println("s1:"+s1);
char[] chs={'a','b','c'};
String s2=new String(chs);
System.out.println("s2:"+s2);
byte[] bys={97,98,99};
String s3=new String(bys);
System.out.println("s3:"+s3);
String s4="abc";
System.out.println("s4:"+s4);
}
}