File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Regarding Abstract Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Regarding Abstract Class" Watch "Regarding Abstract Class" New topic
Author

Regarding Abstract Class

Mohana Priya
Ranch Hand

Joined: Jan 16, 2005
Posts: 45
An Absract class with concrete static methods alone need not be sub-classed in its life time .Am I right ?


SCJP 1.4<br />SCWCD 1.4
Burkhard Hassel
Ranch Hand

Joined: Aug 25, 2006
Posts: 1274
Did you mean cannot be subclassed?
If so the answer is no, can be subclassed.

But this class needs not to be abstract, methods being static or not.
Yours,
Bu.


all events occur in real time
Jeronimo Sanchez
Greenhorn

Joined: Jul 17, 2006
Posts: 23
What I think Mohana is trying to ask is if all methods in an abstract class are static, do we need to sub-class the class? And the answer is no, we do not need to do so to call the static methods.

It's perfectly legal to invoke static methods within abstract classes. Check the foloowing example:



Other question is why to have an abstract class with only static methods.


Preparing SCJP 1.5
Dave Reinhardt
Ranch Hand

Joined: Aug 07, 2006
Posts: 54
There are a few abstract classes with static methods in the API that are part of the SCJP exam. See page 471 in SCJP

java.util.Calendar
java.text.DateFormat
java.text.NumberFormat

Can anyone name others that we need to know for the exam?
 
Don't get me started about those stupid light bulbs.
 
subject: Regarding Abstract Class