0% found this document useful (0 votes)
4 views1 page

Java Package Structure and Access Modifiers

The assignment requires the creation of a Java package structure with a main package and two sub-packages: employees and utilities. Within the employees package, an Employee class with private attributes and access modifiers must be created, along with subclasses Manager and Developer. The utilities package will contain a class for employee operations, and a main class will demonstrate the functionality, all while including Javadoc comments for documentation.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Java Package Structure and Access Modifiers

The assignment requires the creation of a Java package structure with a main package and two sub-packages: employees and utilities. Within the employees package, an Employee class with private attributes and access modifiers must be created, along with subclasses Manager and Developer. The utilities package will contain a class for employee operations, and a main class will demonstrate the functionality, all while including Javadoc comments for documentation.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Assignment Question1:

● Objective: To demonstrate understanding of Java packages and access modifiers.


Instructions:

● Create a Package Structure: Create a Java package named [Link]. •

● Inside this package, create two sub-packages named employees and utilities.

● Employees Package: Inside the employees package, create a class named Employee. •
Include private attributes such as name, employeeId, and salary. • Implement appropriate
access modifiers (e.g., private, protected, public) for the class members. • Provide getter and
setter methods to access and modify the private attributes

● Subclasses: • Create two subclasses within the employees package: Manager and Developer.
• Each subclass should extend the Employee class. • Introduce additional attributes specific
to managers and developers. • Implement getter and setter methods for the additional
attributes.

● Utilities Package: • Inside the utilities package, create a class named EmployeeUtilities. •
Implement methods in EmployeeUtilities that use the employees from the employees
package. • Demonstrate the proper usage of access modifiers within the EmployeeUtilities
class.

● Main Class: • Create a main class named AssignmentMain outside of any package. • In the
AssignmentMain class, create instances of Manager and Developer. • Use the
EmployeeUtilities methods to perform operations on the employee objects.

● Documentation: • Provide Javadoc comments for each class and method, emphasizing the
proper use of access modifiers

You might also like