Share

Exercise 1

d34d00cfd8645d02fd8593c283eeb93f0d56908a3babcde04956db539ba9a730

Public

07 August 2017

Views: 14

package java_project;

public class employee {
public int age;
public String name;
public void setage(int abc)
{
age=abc;
}
public void setname(String xyz)
{
name=xyz;
}
public int getage()
{
//System.out.println(age);
return age;
}
public String getname()
{
//System.out.println(name);
return name;
}
public void showemployeedetails()
{
System.out.println("name:");
System.out.println(name);
System.out.println('
');
System.out.println("age:");
System.out.println(age);
}
public static void main(String[] args) {
employee a=new employee();
a.setage(20);
a.setname("abcd");
a.getage();
a.getname();
a.showemployeedetails();
}
}

Passcode: