a) If a base class has a method such as : public int ABC(), an inherited class cannot reduce accessibility to this method by declaring it as protected (i.e. protected int ABC()) b) Assume class B in inherited from class A. The following statement, where a1 and b1 are references to objects from A and B respectively, would result in compilation error: a1 = (A)b1; c) A constructor of an inherited class has the right to call the this() constructor and the super() constructor but super() must be called first d) Even if a class A is created as an abstract class, the following code will still be okay: A a1; e) The keyword extends indicates polymorphism.

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 6PE
icon
Related questions
Question

 

PLZ help with the following:
IN JAVA asnwers if the following are true or false

True/False

a) If a base class has a method such as : public int ABC(), an inherited class cannot reduce accessibility to this method by declaring it as protected (i.e. protected int ABC())

b) Assume class B in inherited from class A. The following statement, where a1 and b1 are references to objects from A and B respectively, would result in compilation error: a1 = (A)b1;

c) A constructor of an inherited class has the right to call the this() constructor and the super() constructor but super() must be called first

d) Even if a class A is created as an abstract class, the following code will still be okay: A a1;

e) The keyword extends indicates polymorphism.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Reference Types in Function
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