EmployeeDriver
Mon Jan 01 2024 19:33:33 GMT+0000 (Coordinated Universal Time)
Saved by
@javaA
import java.util.Scanner;
class EmployeeDriver{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
Employee e1=new Employee();
System.out.println("Enter Employee 1 Details : ");
System.out.print("Enter ID : ");
e1.setEno(sc.nextInt());
System.out.print("Enter Name : ");
e1.setName(sc.next());
System.out.print("Enter Designation : ");
e1.setDesignation(sc.next());
System.out.println("Enter Employee 2 Details : ");
System.out.print("Enter ID : ");
int e=sc.nextInt();
System.out.print("Enter Name : ");
String name=sc.next();
System.out.print("Enter Designation : ");
String designation=sc.next();
Employee e2=new Employee(e,name,designation);
System.out.println("Employee 1 Details : ");
System.out.println(e1.getEno()+" "+e1.getName()+" "+e1.getDesignation());
System.out.println("Employee 2 Details : ");
System.out.println(e2.getEno()+" "+e2.getName()+" "+e2.getDesignation());
}
}
content_copyCOPY
Comments