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 should I use abstract classes and when should I use
interfaces?

Answers were Sorted based on User's Feedback



When should I use abstract classes and when should I use interfaces?..

Answer / ved.b.tripathi

Interface : when you about to maintain the standard through
out the application then,blindly go with the interface.

Abstract : when you customize the behavior but still want to
maintain some standard then use abstract,because in abstract
you can have non abstract method that will be use by every
class that extend this abstract method and that class also
have to give the body of abstract methods(standard).

Is This Answer Correct ?    15 Yes 2 No

When should I use abstract classes and when should I use interfaces?..

Answer / ankit

if u r required more than 1 class in ur prog then use
interface because u cant extends 2 class in ur prog ...to
use 2 class in ur prog u can implement 1 interface and
extends 1 class

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is abstract class? Explain

0 Answers  


i would like to attend for an interview of datalab technologies company i want to know the pattern of imnterview.

0 Answers  


Explain the difference between abstract classes and interfaces in java?

0 Answers  


When we r go to abstract class and when we go to Interface? i have confusion this question while in interview plz clarify

3 Answers   HCL, Photon,


C and C++ has constructors and distructors, why does Java does not have distructors?

1 Answers   T3 Softwares,


Explain about vector, dictionary,hash table, property classes?

1 Answers   Patni,


What is keyword in oop?

0 Answers  


What is an immutable object?

0 Answers  


What are synchronized methods ?

0 Answers  


Can we have a try block without catch block?

0 Answers  


What is predicate in java?

0 Answers  


What is the argument type of main() method?

2 Answers  


Categories