本帖最后由 wyf20106 于 2014-8-10 23:19 编辑
- class Person
- {
- private String name;
- private int age;
- Person(String name)
- {
- this.name = name;
- }
- Person(String name,int age)
- {
- this.name = name;
- this.age = age;
- }
- public void speak()
- {
- System.out.println("name="+this.name+"...age="+this.age);
- this.show();
- }
- public void show()
- {
- System.out.println(this.name);
- }
复制代码
|
|