Which of the following is/are true for an abstract class?
1. A class is declared abstract by prefacing the definition with the word abstract.
2. A class is declare abstract by using the keyword implements.
3. It is a class that really isn’t supposed to ever be instantiated but instead serves as a base class.
4. Attempting to instantiate an abstract class results in an error.
A.Only 2
B.All of the mentioned
C.2 and 4
D.2, 3 and 4
Answers
Answered by
2
heya !
option A is the answer
A class is declare abstract by using the keyword implements.
hope this helps you
option A is the answer
A class is declare abstract by using the keyword implements.
hope this helps you
Answered by
0
A. Only 2 is/are true for an abstract class.
Explanation for the answer:
- The correct statement is: A class is declared abstract by using the keyword implements.
- An abstract class allows you to prepare functionality which subclasses can implement or override.
- An interface allows you to specify functionality, not implement it.
- All the rest statements are not true expect the 2 one.
- Hence, the correct answer among all the options is option A. Only 2.
(#SPJ3)
Similar questions
History,
6 months ago
Business Studies,
6 months ago
Computer Science,
1 year ago
Math,
1 year ago
English,
1 year ago
Math,
1 year ago