Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a JAVA code to implement the following: 1. Create a super class named Human, that has the following members: (.25 Point) a private String

Write a JAVA code to implement the following:
1. Create a super class named Human, that has the following members: (.25 Point)
a private String attribute name (.25 Point)
constructor to initialize the attribute name. (.25 Point)
set method to change the values of name. (.25 Point)
get method to return the values of name. (.25 Point)
override method toString to print the value of name. (.5 Point)
2. Create a sub class named Employee that,
inherits from superclass Human (.5 Point)
has a private attribute ID (.25 Point)
constructor to initialize the attributes name
(via superclass constructor) and ID. (0.5 Point)
3. Write a Test class that has the main method:
Declare a reference e of Employee class (.25 point)
Create an object of Employee class (with name Ahmed and 123 ID)
and assign it to the e reference (.5 point)
Call toString method to print the name and ID. (.25 point)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions

Question

(1) (:) 1. Solve the initial value problem ' with (0): ||

Answered: 1 week ago

Question

=+and reduction in force, and intellectual property.

Answered: 1 week ago