Page 533 - Cs_withBlue_J_C11_Flipbook
P. 533
23
24 void display() // Defining display()
25 {
26 System.out.print("\n\tEmployee Id : "+Id);
27 System.out.print("\n\tEmployee Name : "+Name);
28 System.out.print("\n\tEmployee Age : "+Age);
29 System.out.print("\n\tEmployee Salary : "+Salary);
30 }
31
32 public static void main(String args[])
33 {
34 Employee ob = new Employee();// Creating Object
35 ob.getData(); // Calling GetData()
36 ob.display(); // Calling display()
37 }
38 }
The output of the preceding program is as follows:
Enter Employee Id : 1
Enter Employee Name : Abik
Enter Employee Age : 25
Enter Employee Salary : 10000
Employee Id : 1
Employee Name : Abik
Employee Age : 25
Employee Salary : 10000
Variable Description
NAME TYPE DESCRIPTION
id int To store the id of the employee
name string To store the name of the employee
age int To store the age of the employee
salary long To store the salary
531
Internal Assessment 531

