Difference between abstract class and Interfaces?

Answer Posted / nanthinikrishnan

An abstract class can have concrete method, which is not
allowed in an interface. Abstract class can have private or
protected methods and variables and only public methods and
variables are allowed in interface. We can implement more
than one interface , but we can extend only one abstract
class. Interfaces provides loose coupling where as abstract
class provides tight coupling.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a dynamic array in java?

802


Difference between static and dynamic class loading.

806


Can we use a switch statement with strings?

777


Which category the java thread do fall in?

766


What does indexof return in java?

757


Why does java not support operator overloading?

907


Is this valid in java ? Can we instantiate interface in java?

766


What is the purpose class.forname method?

757


Can we call a non-static method from inside a static method?

783


What is the length of a string?

753


What is memory leak and how does java handle it?

769


What are the actions that can occur when a thread enters blocked state?

820


What is size of int in java?

807


What is a protected void?

709


How can we make a class singleton?

820