Dog 5$Dog-5 Cat 2$Cat-2 //3 //4 //5 //6 ここまでは設定 InputStream fileStream = new FileInputStream("data.txt"); System.setIn(fileStream); Scanner sc = new Scanner(System.in); //1.Animal型の変数 a1 を宣言, Animal型のインスタンスを生成して代入 //2. a1 の type をキーボード入力から代入 ???? = sc.next(); //3. a1 の age をキーボード入力から代入 ???? = sc.nextInt(); //4. Dog-5 のように a1 の type と age の値を表示 //class class Animal { String type; //種類 int age; //年齢 }