Employee Management System Using Inheritance in Java
This program will help you in creating an simple Employee Management System using java language. In this program a class emp is used which has name, id and salary as data members. inside it there are two methods namely get() and disp() which work as getting user input and displaying the output. Scanner class is used as well. This program is an implementation of array of objects.
Sample Output :
The Code here:
Sample Output :
The Code here:
import java.util.*; class emp { public String name; public int id,sal; public void get() { Scanner s=new Scanner(System.in); System.out.print("Enter The Name: "); name=s.next(); System.out.print("Enter The id: "); id=s.nextInt(); System.out.print("Enter The sal: "); sal=s.nextInt(); s.close(); } public void disp() { System.out.println("The Name of the employee is "+name+" having id: "+id+"and a salary worth to: "+sal); } } class MainClass extends emp { public static void main(String []arg) { Scanner s=new Scanner(System.in); int cnt=0,i=0; System.out.print("Enter The number of Employees: "); cnt=s.nextInt(); emp e[] = new emp[cnt]; for(i=0;i<cnt;i++) { e[i]= new emp(); e[i].get(); } for(i=0;i<cnt;i++) { e[i].disp(); } s.close(); } }Share it if you found is useful !
Thanks for sharing this informative blog
ReplyDeleteLearning Management Software
This comment has been removed by the author.
ReplyDeleteThanks for clear my query !
ReplyDeleteLeave management system
All of these tips are great, that’s very interesting. I’m so tempted to try that myself, but you would think if it were effective, more people would do it.
ReplyDeleteHR Chatbot
HR Bot
Employee Chatbot
Human Resources Chatbot
HR Chatbot Dubai
HR Chatbot UAE
Conversational HR Chatbot
Great blog learned many things about HR tools from this blog, very informative.
ReplyDeleteEmployee Engagement Software
Employee Engagement Platform
Employee Recognition Apps
Hr Analytics Tool
Hr Analytics Software
Performance Management Software
Thanks for share your blog here . Staff management system
ReplyDeletescheduling employees software I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
ReplyDeleteNice blog. Thanks for sharing this. employee holiday tracking system
ReplyDelete