Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can we say an interface is an abstract class?  RSS feed

 
Praveen palukuri
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
please reply for this query :
can we say an interface is an abstract class?

Thank you.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. You can extend an abstract class to create a concrete implementation, but you can only extend an interface to make another interface. You could describe interfaces as "abstract" things though, since they in themselves provide no implementation.
[ April 20, 2006: Message edited by: Paul Sturrock ]
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Praveen, the question "what is the difference between an interface and an abstract class" is a frequently asked question on the forums here. If you do a search, you'll find lots of threads with useful answers to the question.
 
faisal usmani
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Praveen ,

To add a little more to what Paul said, An abstact class can have some concrete methods besides abstact methods in it where as interface will always have abstract methods only , there are so many other differences. Do a little google or you can read Head First by K&B.



regards
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!