Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

When we will use an Interface and Abstract class?

Answer Posted / sumit sharma

Interface:-> JDK1.5 and above version provide a superb
functionality through interface. That is the main reason
behind using the interface is basically "Interface provide
the loose coupling and also support multiple inheritance".
This is a 100% abstract class. This is also support and
flexible with Polymorphism.
For Example:-
List<String> list = new ArrayList<String>();
Where as List is an interface while ArrayList is an class.


Abstract:-> Abstract class doesn't support multiple
inheritance and if you are creating an any abstract in any
ordinary classes then you must declare abstract. this is
also a major disadvantage of abstract class is that if you
are extend and class or abstract class then you can't extend
any one. Abstract class can't initialize only extended it.
Abstract class may have at least one or more abstract method.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does flag mean in java?

969


Why heap memory is called heap?

994


Is arraylist a class in java?

997


Can you start a thread twice in Java?

1062


What is the mapping mechanism used by java to identify IDL language?

959


What is the symbol for average?

977


How do you use wildcards?

984


Is space a char?

880


Difference between ‘>>’ and ‘>>>’ operators in java?

1078


What does next mean in java?

926


What are the advantages and disadvantages of reference counting in garbage collection?

973


What if static is removed from main method?

1015


What is the Scope of Static Variable?

1165


What is finally block?

980


Explain about main() method in java ?

1002