In real time project when will we use Abstract class. and
what are the difference between abstract and interface.
Answer Posted / naveen verma
Abstract Class:- its should have declared as abstract and must contain atleast one abstract method. an abstract class can be extended from either an abstract class or the class which is extending the abstract class should implement all methods of abstract method.
Interface:- In interface the methods are only declared not define the class which implementing the interface can define the method body as per its need. its not mendatory to define every method of the interface.
In really time application we extend abstract class only we when we need to modify the class. where as interface can be used to implements its method.
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
What is the difference between system.out ,system.err and system.in?
What is the difference between the string and stringbuffer classes?
How would you detect a keypress in a jcombobox?
Should synchronization primitives be used on bean methods?
What is the difference between long.class and long.type?
What is glasgow?
What modifiers may be used with an interface declaration?
what is a non-repeatable read?
What are the diff types of exception?
Is “abc” a primitive value?
Is jvm a overhead?
Explain ioc concept?
In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?
What is a clone?
Why won’t the jvm terminate when I close all the application windows?