class Person
{
private String name;
private int age;
public void setName(String n) //下面getName也为String
{
name=n;
}
public String getName()
{
return name;
}
public int setAge(int a) //下面getAge也为int
{
age=a;
}
public int getAge()
{
return age;
}
void speak()
}
class PersonDemo1
{
public static void main(String[] args)
{
Person p=new Person();
p.setName("lishi");
p.setAge(20)
System.out.println(p.getName()+"::"+p.getAge());
}
}