Java Sample Code

Java Sample Code

public class Employee{
   String name;
   int age;
   String designation;
   double salary;

   public Employee(String name){ = name;

   public void empAge(int empAge){
      age =  empAge;

   public void empDesignation(String empDesig){
      designation = empDesig;

   public void empSalary(double empSalary){
      salary = empSalary;

   public void printEmployee(){
      System.out.println("Name:"+ name );
      System.out.println("Age:" + age );
      System.out.println("Position:" + designation );
      System.out.println("Salary:" + salary);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s