import java.util.Scanner;
public class TestS {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("请输入一串字符a");
String a = input.next();
System.out.println("请再输入一串字符b");
String b = input.next();
System.out.println("a和b的连接字符为:"+ a + b);
}
}
import java.util.Scanner;
public class test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String a = sc.nextLine();
String b = sc.nextLine();
System.out.println(a+b);
}
}
console:
abc
def
abcdef