This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

In the real world where can i use the interfaces and abstract classes .

 
sajja bala
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers

My dilema is ; in the real world where can i exactly use the interface and the abstract class. I want the clear scenario in the usage.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might start by working through the Java Tutorial chapter on interfaces and inheritance.
 
Atulya Mahajan
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To put it roughly, an interface is an idea, but an abstract class goes a step ahead in implementing that idea, but not completely.

Comparable interface doesnt do anything itself, but any class implementing the interface has the distinct behavior of being able to compare its objects.

An abstract class says that hey, i am implementing some stuff that will apply to all subclasses, but there are some things so specific that it doesnt make any sense for me to define those. That stuff is left for the subclasses.

hope this helps!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic