0% found this document useful (0 votes)
10 views

java employee details

Uploaded by

fojimaw327
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

java employee details

Uploaded by

fojimaw327
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.util.

Scanner;

public class Employee


{

int empid;
String name;
String dept;
int age;
String email;

public void setemployees()


{

Scanner in = new Scanner(System.in);


System.out.print("Enter the empid :: ");
empid = in.nextInt();
System.out.print("Enter the name :: ");
name = in.next();
System.out.print("Enter the department :: ");
dept = in.next();
System.out.print("Enter the age :: ");
age = in.nextInt();
System.out.print("Enter the email :: ");
email = in.next();
}

public void display()


{

System.out.println("Employee id = " + empid);


System.out.println("Employee name = " + name);
System.out.println("Employee departmen = " + dept);
System.out.println("Employee age = " + age);
System.out.println("Employee email = " + email);
}

public static void main(String[] args)


{
Employee e[] = new Employee[5];

for(int i=0; i<5; i++) {

e[i] = new Employee();


e[i].setemployees();
}

System.out.println("**** Data Entered as below ****");


for(int i=0; i<5; i++) {

e[i].display();
}
}
}

You might also like