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...

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


Please Help Members By Posting Answers For Below Questions

Explain how will the struts know which action class to call when you submit a form?

922


Why use POJO when I can use hashmap

2599


What are callback interfaces?

1058


Can I map more than one table in a cmp?

1039


what is Activation Instantinator?

2381


How to implement RMI in Java?

2841


What are transaction attributes?

1052


Why use a datasource when you can directly specify a connection details?

981


What is the purpose of the wait(), notify(), and notifyall() methods?

980


Describe, in general, how java's garbage collector works?

994


Do we need to override service() method

1666


What are the pros and cons of detached objects?

939


What is meant by method chaining?

1101


what are getters and setters in Java with examples?

1740


How will you pass parameters in RMI? Why do you serialize?

1178