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.

  1.  
  2. Consider Employee as a part of payroll system. What could be the attributes that will be needed in system?
  3.  
  4. How many constructors this class should have?
  5.  
  6. What are other methods this class can have?
  7.  
  8. Briefly explain the purpose of the following line of code:
  9.  

Employee employee1 = new Employee();

  1. 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).
  2. 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.


  1. Rectangle Class
    1. How many constructors does the class Rectangle provide?



Step by Step Solution

3.43 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Class A class in objectoriented programming serves as a blueprint or template for creating objects I... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

6642faf00e046_963194.pdf

180 KBs PDF File

Word file Icon

6642faf00e046_963194.docx

120 KBs Word File

Students Have Also Explored These Related Operating System Questions!