-2

Possible Duplicate:
Interface vs Abstract Class (general OO)
When to use abstract class or interface?

Can you provided implementations on a abstract class?

what's the difference between these two?

and when will I know when will I know to use them?

Community
  • 1
  • 1
user962206
  • 15,637
  • 61
  • 177
  • 270
  • Have a look at this: http://download.oracle.com/javase/tutorial/java/index.html. Maybe you have any concrete questions? – home Nov 14 '11 at 12:37
  • Good starting point - [Interfaces and Inheritance](http://download.oracle.com/javase/tutorial/java/IandI/index.html). – mre Nov 14 '11 at 12:37

2 Answers2

2

This pages gives a good comparison: http://download.oracle.com/javase/tutorial/java/IandI/abstract.html . You could have found it with a very quick google search.

Joe
  • 46,419
  • 33
  • 155
  • 245
1

Interface is used for defining a contract. Abstract classes are used for defining some methods which are common to all descendants and possibly some methods which will differ(they will be abstract). With interfaces or abstract classes polymorphism is reached.

Petar Minchev
  • 46,889
  • 11
  • 103
  • 119