Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
does an abstract method require an abstract class?
Mike Noel
Ranch Hand
Posts: 108
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If I have a method marked as abstract it seems to make sense that the class would also have to be marked abstract. Right?
Mike Noel
Doyle Matt
Ranch Hand
Posts: 76
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
marked method?
are you referring to annotations? if not then is a method is "declared" abstract then its class declarations should also be "declared" abstract as well.
SCJP 1.4
Mike Noel
Ranch Hand
Posts: 108
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Yes, sorry for the confusion. I mean declared abstract.
Mike Noel
ankur rathi
Ranch Hand
Posts: 3852
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
... or it should not be a class but interface.
Revathi Velu
Greenhorn
Posts: 8
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If a method is abstract then the class containing the method MUST be abstract. You cannot have an abstract method inside a non-abstract clas.
The converse however is not true. You can have one or all non-abstract methods inside an abstract class.
Hope this helps.
Revathi
Thanks<br />Revathi
Douglas Chorpita
Ranch Hand
Posts: 97
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Great job, Revathi!!
SCJP 1.4 - 95%
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Advantages of abstract class in ejb2.0
problem in running abstract class
abstract / non abstract class
strictfp and abstract
Abstract class
More...