Question OOP-ABS-0050
MediumCan you declare a variable of an abstract class type in Java, such as Shape s;?
- A.
Only if it is static
- B.
No, never
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Abstraction and Interfaces question
Can you declare a variable of an abstract class type in Java, such as Shape s;?
Only if it is static
No, never
Sign up free to see the answer and a step-by-step explanation.
Only inside the abstract class
Yes, it can refer to any concrete subclass object