Create the Inheritance Java program of the problem below. SUPERCLASS *Create a Class "Pet" *Instance petName (MODIFIER

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Create the Inheritance Java program of the problem below. SUPERCLASS *Create a Class "Pet" *Instance petName (MODIFIER

Post by answerhappygod »

Create the Inheritance Java program of the problem below.
SUPERCLASS
*Create a Class "Pet"
*Instance petName (MODIFIER IS Public)
*Create a Constructor
Mutator
Accessor
speak() ["I'm your cuddly little pet."]
SUBCLASS
Bird
*Create a Method
speak() ["I speak only when I want to."]
Duck
*Create a Method
speak() ["Kwak Kwak"]
MAIN
OUTPUT:
I'm your cuddly little pet. ---OBJECT FOR PET
Hi, my name is Cha Cha ---OBJECT FOR CAT
I speak only when I want to. ---OBJECT FOR CAT
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply