what is the difference between abstract class and
Interface?where we can use it in realtime projects?
Answer Posted / nitesh
1)We define an Interface in the Java application with a
set of abstract methods without any implementation. Which
means all the methods of an interface are by default
abstract methods and public methods.
2)Once an Interface is defined in the application then any
class can implement that interface, in such case the class
must be implemented with all the mehtods of the respective
Interface otherwise the class will become as abstract class.
3)A class can implement any no. of interfaces, in such case
the class must be implimented with all the methods of those
interfaces otherwise the class will become as abstract class
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are encapsulation, inheritance and polymorphism?
Can an arraylist be empty?
Differece between class and generic class?
Can you call one constructor from another if a class has multiple constructors?
Where is jre installed?
What is defined as false sharing in the context of multithreading?
Which class should you use to obtain design information about an object in java programming?
What is the advantage of preparedstatement over statement?
What are the main differences between the java platform and other platforms?
What is methods in java?
How do you clear a list in java?
What is meant by tab pans?
What is loop in java?
How large is a boolean?
When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?