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

regarding Abstract class and Interface

 
kavitha vasu
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At which situation we are moving to abstract class and interface

Explain me with example
 
abhrodip paul
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you implement Interface it will force you to implement the method of the interface also. ok. So when ever you want this kind of situation you can use Interface. Like in Runnable interface java developers want you to implement run method, thats why they made it an Interface.

And Abstract classes are for future utilization. If you are sure that you are or some one else going to improve your class in the future then keep it Abstract.Example Abstract Class AbstractList.
 
abhrodip paul
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
kavitha vasu
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Thanks for your reply.

Could you me any real time example for these 2 concepts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic