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 module with example?
Why does java not allow multiple public classes in a java file ?
What are the advantages of user defined functions?
How do you do a line break in java?
What data type is true or false?
Write a program in java to establish a connection between client and server?
How do you convert int to char in java?
What is the difference between inner class and nested class?
Explain about interrupt() method of thread class ?
Why put method is idempotent?
Explain methods specific to list interface?
How to reverse string in java?
What is a null check?
In which order the iterator iterates over collection?
describe method overloading