Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

abstract class and Interface

 
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 ?
 
lowercase baba
Posts: 12871
62
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?
 
Marshal
Posts: 69874
278
  • 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.
 
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
Marshal
Posts: 69874
278
  • 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.
 
I'm not sure if I approve of this interruption. But this tiny ad checks out:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic