In this program, we are implementing Getters and Setters. Getters are used to access data members so they are also called accessors and Setters are used to change the data memebers values so they are called Mutators.
Enter Employee Data:
Enter Id :101
Enter Name :Pankaj
Enter Gender:Male
Enter City :Delhi
Enter Salary:70000
Displaying Employee Data:
Id : 101
Name : Pankaj
Gender : Male
City : Delhi
Salary : 70000
Program:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer