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 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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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?
 
jQuery in Action, 2nd edition
 
subject: Regarding Abstract Class
 
Similar Threads
Doubt about diagram class (realization)
WA #1.....word association
can non-static inner class access any member
andrew has wii
Doubt about diagram class