What is difference between abstract class & final class
Answer Posted / farhad
A final class CANNOT be extended or subclassed however it can be instantiated:
final class A{
}
class B{
A a = new A(); //<<< instantiating final class A
We cannot say:
class B extends A //!!! that's a NO NO.
On the other hand abstract class can be subclassed but CANNOT be instantiated.
abstract class A{
}
class B extends A{
}
| Is This Answer Correct ? | 9 Yes | 6 No |
Post New Answer View All Answers
List down the methods and interfaces of collection class in java.
Why are functions called methods in java?
How many types of design patterns are there?
Why is a string immutable?
What is static import?
What means public static?
How does list work in java?
What is difference between arraylist and list in java?
What is a class variable?
Do you need to import math in java?
What are scriptlets?
What is the difference between scrollbar and scrollpane?
What is the purpose of a transient variable?
Distinguish between a predicate and a function?
What is java util collection?