Create a Java project that demonstrates various object oriented concepts you have learned so far in this course (encapsulation, inheritance and polymorphism). To do this, create a super class and at least 2 subclasses. You can either do multilevel inheritance or hierarchical inheritance in this to complete this part-2 task. The super class will have following properties/functionalities: a) Create a total of 3 member variables for the class, selecting the appropriate data types for each field. b) Include an argument constructor in this Class, that will initialize all data fields. c) Encapsulate this Class. The two subclasses will have below properties/functionalities: a) One of the subclasses will have at least one member variable and other subclass with at least two member variables. b) Have two constructors in each subclass: • One constructor for initializing only super class data • Another constructor will initialize both super and subclass data. c) Encapsulate the subclasses. d) You should include overloaded methods in any of the classes you have created (superclass or subclass). e) Override the toString( ) method in each of your Classes. f) Override the equals( ) method in each of your Classes. The test class [with the main ( ) method] will perform below tasks: a) Create objects of superclass and each subclass types invoking all constructors and Draw the object diagram for each of the object created. b) Use setter methods to fill missing data in all objects. c) Generate outputs demonstrating overloading, overriding outputs. d) Create object of subclass [actual type] and store it in superclass object [declared type]. e) Generate output for instanceof operator. f) Do object casting (show both implicit and explicit) g) Generate output for constructor chaining [using this and super keywords]

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Create a Java project that demonstrates various object oriented concepts you have learned so far
in this course (encapsulation, inheritance and polymorphism). To do this, create a super class and
at least 2 subclasses. You can either do multilevel inheritance or hierarchical inheritance in this
to complete this part-2 task.
The super class will have following properties/functionalities:
a) Create a total of 3 member variables for the class, selecting the appropriate data types
for each field.
b) Include an argument constructor in this Class, that will initialize all data fields.
c) Encapsulate this Class.
The two subclasses will have below properties/functionalities:
a) One of the subclasses will have at least one member variable and other subclass with at
least two member variables.
b) Have two constructors in each subclass:
• One constructor for initializing only super class data
• Another constructor will initialize both super and subclass data.
c) Encapsulate the subclasses.
d) You should include overloaded methods in any of the classes you have created
(superclass or subclass).
e) Override the toString( ) method in each of your Classes.
f) Override the equals( ) method in each of your Classes.
The test class [with the main ( ) method] will perform below tasks:
a) Create objects of superclass and each subclass types invoking all constructors and Draw
the object diagram for each of the object created.
b) Use setter methods to fill missing data in all objects.
c) Generate outputs demonstrating overloading, overriding outputs.
d) Create object of subclass [actual type] and store it in superclass object [declared type].
e) Generate output for instanceof operator.
f) Do object casting (show both implicit and explicit)
g) Generate output for constructor chaining [using this and super keywords]
Note:
1) Draw object diagrams wherever possible and necessary to show the state of the objects
created
Include the below in your project report:
• The UML diagram of all Classes.
• Screenshots of all output generated from the application.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY