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
What is the synonym of string?
What is string in java? String is a data type?
How many bytes is a string?
What are different types of references?
What is method in java ?
Is empty string in java?
Why does java have different data types for integers and floating-point values?
What is string [] java?
What is natural ordering in java?
What is the most important feature of java? What is an interface?
Can we execute a program without main() method?
How do you call a reference in java?
What do you mean by buffering?
Why do we need autoboxing in java?
What are the four pillars of java?