Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abstract class and Interface

 
Ramakrishna Gummadi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can abstract class and interface have 0 or more abstract methods ?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12083
29
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramakrishna Gummadi wrote:Can abstract class and interface have 0 or more abstract methods ?

What happened when you tried to do it?
 
Campbell Ritchie
Sheriff
Posts: 48363
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhanu Chowdary, please note what is says on the "Beginning Java" contents page:
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
By providing an answer too quickly, you risk depriving people of the opportunity to learn for themselves.

I have obscured your answer, so you are the only ranch hand who can see it.
 
bhanu chowdary
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Bhanu Chowdary, please note what is says on the "Beginning Java" contents page:
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
By providing an answer too quickly, you risk depriving people of the opportunity to learn for themselves.

I have obscured your answer, so you are the only ranch hand who can see it.

I would keep that in mind from now on.
 
Ramakrishna Gummadi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created empty interface... with no abstract methods

It means an interface can have 0 or more abstract methods
 
bhanu chowdary
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramakrishna Gummadi wrote:I created empty interface... with no abstract methods
It means an interface can have 0 or more abstract methods

Now try the same for abstract class and see what is happening
 
Campbell Ritchie
Sheriff
Posts: 48363
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look in the Java™ Language Specification; I am not sure whether I have given you the most useful link, and it isn't easy to read.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic