• Post Reply Bookmark Topic Watch Topic
  • New Topic

can and any one this abstract and interface  RSS feed

 
kajal mukergi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.what is the main difference between abstract class and an interface?

2. give the real time example for abstract class and interface?
 
Rahul
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abstract classes are the classes which contains methods having no implementation or may have their implementation. Whereas, Interfaces CANNOT have method implementation. In short Interfaces are like Abstract classes but NO methods with implementation. I hope this clear your doubt.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question "what is the difference between an interface and an abstract class" is asked often here on JavaRanch, so we have something about this in our FAQ: InterfaceVsAbstractClass.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Rahul,

I am one of the moderators of the JavaRanch forums. Here on JavaRanch, we have a naming policy. We want the users of JavaRanch to use a real-sounding name as their display name.

Unfortunately, your name "Rahul" does not comply to the naming policy. Your display name should consist of a real-sounding first name, space, and a second name. Not only a first name, no obviously fake nickname, no initials only for the second name.

Please read the naming policy carefully and change your display name. You can change your name by editing your profile.

Please note that we are taking the naming policy seriously. If you do not change your display name, your account on JavaRanch might be locked.

Have fun on JavaRanch,
Jesper Young - Bartender
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!