class Person应该声明为public ,即public class Person

解决方案 »

  1.   

    char breathe->String breathe
      

  2.   

    你输入的都是字符串,怎么可以定义成CHAR?
      

  3.   

    问题在这里,
     p1.breathe="good";
         p2.breathe="poll";
    怎么改呢。
      

  4.   

    class Person
    {
      int age;
      char breathe;   //使用:  String breathe;
      void shout()
      {
       System.out.println("oh,my god! my age is" +age);
       System.out.println("oh,my god! my breathe is" +breathe);
      }
    }
      

  5.   

    1、breathe的类型与赋值不符。
    2、class TestPerson声明为public,文件名也应为TestPerson.java