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
Describe the process as to how substring() methodology mechanisms in java.
What do you mean by an interface in java?
What is method reference in java?
Which java version is latest?
Is java map thread safe?
What are the benefits of operations in java?
java program with complete 4 oops concepts implemented example
Explain the difference between the public, private, final, protected, and default modifiers?
Is an integer an object?
How to display names of all components in a Container?
What are inbuilt functions?
Will minecraft java be discontinued?
What are different types of references?
What is replaceall in java?
Is java written in c?