1.输出
System.out.println(); //输出且换行
System.out.print(); //输出且不换行
System.out.printf(); // 格式化输出
2.输入
import java.util.Scanner //导入包
public class HelloWorld{
public static void main(String[] args){
Scanner scanner =new Scanner(System.in); //创建Scanner类并传入System.in
String name = scanner.nextLine(); //读取字符串
int age = scanner.nextInt(); //读取int
System.out.printf(name+age);
}
}