Ask Question
22 May, 07:23

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

+1
Answers (1)
  1. 22 May, 10: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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers