Ask Question
10 April, 15:16

Given code:public abstract class A{ }public class B extends A{}The following code sequence would correctly create an object reference of class A holding an object reference for an object of class B:A c; c = new B (); TrueFalse

+5
Answers (1)
  1. 10 April, 18:25
    0
    True.

    Explanation:

    In the code given in the question we have an abstract class A. Then we have a class B which inherits the class A it is also an example of single inheritance.

    Line A c; creates a reference of A type.

    Line c=new B (); states that the reference of A type will refer to an object of class B.

    Hence we conclude that the answer is True.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Given code:public abstract class A{ }public class B extends A{}The following code sequence would correctly create an object reference of ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers