-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestEmployeeDis.java
39 lines (34 loc) · 963 Bytes
/
TestEmployeeDis.java
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
import java.io.*;
class Employee
{
private String name;
private int e_id;
private float salary;
private boolean status;
DataInputStream sc = new DataInputStream(System.in);
void setData()throws IOException
{
System.out.println("Enter Name (String) of Employee: " );
name=sc.readLine();
System.out.println("Enter Employee ID (Integer) of Employee: " );
e_id=Integer.parseInt(sc.readLine());
System.out.println("Enter Salary (Float) of Employee: " );
salary=Float.parseFloat(sc.readLine());
System.out.println("Enter Working Satus (Boolean) of Employee: " );
status=Boolean.parseBoolean(sc.readLine());
}
void getData()
{
System.out.println("Name:"+name+"\nEmp Id:"+e_id+"\nSalary:"+salary+"\nStatus:"+status);
}
}
/*** Main Class***/
class TestEmployeeScan
{
public static void main(String args[])throws IOException
{
Employee e = new Employee();
e.setData();
e.getData();
}
}