-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmpStatic.java
More file actions
52 lines (41 loc) · 1.08 KB
/
EmpStatic.java
File metadata and controls
52 lines (41 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import java.util.Scanner;
public class EmpStatic{
int id;
String name;
double salary;
String dsgn;
static String orgname;
public static void setorgname(){
Scanner sc = new Scanner(System.in);
System.out.println("Enter your Oraganization name: ");
orgname = sc.nextLine();
}
public void Scandata(){
Scanner sc = new Scanner(System.in);
System.out.println();
System.out.println("Enter ID: ");
id = sc.nextInt();
sc.nextLine();
System.out.println("Enter Name : ");
name = sc.nextLine();
System.out.println("Enter Salary : ");
salary = sc.nextDouble();
sc.nextLine();
System.out.println("Enter Designation: ");
dsgn = sc.nextLine();
}
public void Dispdata(){
System.out.println(id + " " + name + " " + salary +" "+ dsgn+" "+orgname );
}
public static void main(String args[]){
EmpStatic.setorgname();
EmpStatic e[] = new EmpStatic[5];
for(int i = 0;i < e.length ; i++){
e[i] = new EmpStatic();
e[i].Scandata();
}
for(int i = 0;i < e.length ; i++){
e[i].Dispdata();
}
}
}