Ask Question
7 February, 04:44

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. 7 February, 05:05
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers