Use JAVA - ​ This task helps you understand how constructors work in inheritance​ Create a superclass, called SuperClass. Create a constructor for it. Inside the constructor, let it print “this is super class.” Create a childclass of SuperClass, called ChildClass. Create a constructor for it. Inside the constructor, let it print “this is child class.” Create a main function and create a new object for ChildClass. Observe what’s printed in console. What will happen if you have a default constructor without parameters in addition to the one with parameters?

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 5PE: Using classes, design an online address book to keep track of the names, addresses, phone numbers,...
icon
Related questions
Question

Use JAVA - ​
This task helps you understand how constructors work in inheritance​

  1. Create a superclass, called SuperClass.
  2. Create a constructor for it. Inside the constructor, let it print “this is super class.”
  3. Create a childclass of SuperClass, called ChildClass.
  4. Create a constructor for it. Inside the constructor, let it print “this is child class.”
  5. Create a main function and create a new object for ChildClass.
  6. Observe what’s printed in console.
  7. What will happen if you have a default constructor without parameters in addition to the one with parameters?
Expert Solution
Step 1

The answer is 

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 2 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning