This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes abstract class and Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "abstract class and Interface" Watch "abstract class and Interface" New topic
Author

abstract class and Interface

Ramakrishna Gummadi
Greenhorn

Joined: Jun 29, 2011
Posts: 16
Can abstract class and interface have 0 or more abstract methods ?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11167
    
  16

Ramakrishna Gummadi wrote:Can abstract class and interface have 0 or more abstract methods ?

What happened when you tried to do it?


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
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

Joined: Mar 09, 2010
Posts: 256
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

Joined: Jun 29, 2011
Posts: 16
I created empty interface... with no abstract methods

It means an interface can have 0 or more abstract methods
bhanu chowdary
Ranch Hand

Joined: Mar 09, 2010
Posts: 256
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

Joined: Oct 13, 2005
Posts: 38045
    
  22
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: abstract class and Interface
 
Similar Threads
abstract class Vs interface
MasterExam OO question
what is the purpose for allowing local variables as abstract ?
Interface instance?
Why abstract classes in java do not have objects, any strong reasons ?