• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

real time example

 
ramesh kothakonda
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi javaranchers
i want an example in what situations we may use interfaces and in what situations we may use abstract classes

thanks
with regards,
k.ramesh
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.javaworld.com/javaworld/javaqa/2001-04/03-qa-0420-abstract.html
http://mindprod.com/jgloss/interfacevsabstract.html
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear friend,
1.If you want to achieve multiple inheritence then go for interface
2.and if you dont want to implement one or two methods in your class then better to go for abstract class



 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note, your question does not have anything to do with "real time". You probably mean you want "real life" examples of the use of interfaces and abstract classes.

Please do a search - the difference between interfaces and abstract classes is a frequently asked question.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic