标签:package return public java sleep
package com.ctgu.java.exer;
public class TestPerson {
}
class Person{
//属性:
String name;
int age;
boolean sex;
//方法:
public void eat(){
System.out.println("人吃饭");
}
public void sleep(){
System.out.println("人睡觉");
}
public String getName(){
return name;
}
public void setName(String n ){
name = n ;
}
public void info(){
eat();
sleep();
System.out.println("name:"+"age:"+age+"sex:"+sex);{
}
}
}
标签:package return public java sleep
原文地址:http://9815936.blog.51cto.com/9805936/1601455