wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes regarding Abstract class and Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "regarding Abstract class and Interface" Watch "regarding Abstract class and Interface" New topic
Author

regarding Abstract class and Interface

kavitha vasu
Ranch Hand

Joined: Feb 22, 2007
Posts: 70
At which situation we are moving to abstract class and interface

Explain me with example
abhrodip paul
Greenhorn

Joined: Oct 16, 2007
Posts: 27
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

Joined: Oct 16, 2007
Posts: 27
kavitha vasu
Ranch Hand

Joined: Feb 22, 2007
Posts: 70
Hi

Thanks for your reply.

Could you me any real time example for these 2 concepts.
 
jQuery in Action, 2nd edition
 
subject: regarding Abstract class and Interface