一、Java中控制台常用输入 输入一行 Scanner in = new Scanner(System.in); String str = in.nextLine(); 二、数组 获取二维数组的行和列 int rows = arr.length; int cols = arr[0].length;