Question: Briefly explain the term class. In your explanation include details on the difference between an object and a class. Consider Employee as a part
Briefly explain the term class. In your explanation include details on the difference between an object and a class.
- Consider Employee as a part of payroll system. What could be the attributes that will be needed in system?
- How many constructors this class should have?
- What are other methods this class can have?
- Briefly explain the purpose of the following line of code:
Employee employee1 = new Employee();
- Create new project, package and create this class with all variables, constructors, getter, setter and other methods (to print the details of object and to calculate the pay of employee).
- Create a test class which will have main method in it and will do as follows:
- Create five different objects of Employee class using all constructors. One should be created at least using non-parametrised constructor.
- For objects created with non-parametrised constructor, use setter to set the values and display the details.
- For all other objects, display details of all employees using other method.
- Rectangle Class
- How many constructors does the class Rectangle provide?
Step by Step Solution
3.43 Rating (169 Votes )
There are 3 Steps involved in it
Class A class in objectoriented programming serves as a blueprint or template for creating objects I... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
6642faf00e046_963194.pdf
180 KBs PDF File
6642faf00e046_963194.docx
120 KBs Word File
