Which of the following is/are correct with reference to Abstract class and interface ?
(a)A class can inherit only one Abstract class but may inherit several interfaces.
(b)An Abstract class can provide complete and default code but an interface has no code.
Codes:
(A) (a) is true
(B) (b) is true
(C) Both (a) and (b) are true
(D) Neither (a) nor (b) is true
Answer: (C)
Explanation: A class can inherit only one Abstract class but may inherit several interfaces.
An Abstract class can provide complete and default code but an interface has no code.
For more information on Abstract class Refer:Pure Virtual Functions and Abstract Classes in C++
Option (C) is correct.
Quiz of this Question
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
11 Jun, 2018
Like Article
Save Article