aspose file tools*
The moose likes Beginning Java and the fly likes Abstract class vs Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Abstract class vs Interface" Watch "Abstract class vs Interface" New topic
Author

Abstract class vs Interface

Rajiv Chelsea
Ranch Hand

Joined: Jun 15, 2010
Posts: 88
Hi

I want to know when to use an Abstract class and when to go for an interface?

Some real examples differentiating the use of two
would be very helpful?

I mean which is better in a particular scenario..
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

this topic discussed here many times. please search here ....
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

We even have an FAQ entry on it.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Rajiv Chelsea
Ranch Hand

Joined: Jun 15, 2010
Posts: 88
I need a real life example....
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Did you look at the FAQ or search? Many, many examples have been provided in the past.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39415
    
  28
You have already been told to search. You might have found this.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Abstract class vs Interface