THE JAVA PROGRAM TO ILLUSTRATE THE METHODS OF SETTING AND RETRIVING VALUES

 import java.lang.*;
class employee
{
String name;
int id;
String addr;

void getdata(String n,int i,String a)
{
this.name=n;
this.id=i;
this.addr=a;
}

void putdata()
{
System.out.println("employee details are \n" + "name:" + name + "\nid:" + id + "\naddress:" + addr);
}

}

class office
{
public static void main(String args[])
{
employee e1=new employee();
e1.getdata("gopal",123,"smg");
e1.putdata();
}
}