class Worker
{
private String name;
private int age;
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return this.name;
return name;
}
public void setAge(int age)
{
this.age = age;
}
public int getAge()
{
return age;
}
}
class WorkerTest
{
public static void main(String[] args)
{
Worker w = new Worker();
System.out.println(w.getName()+"---"+w.getAge());
}
}
|
|