Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Hi Chris, Primitives are not java objects. Hence java contains wrapper classes (java.lang.Integer etc., that also extends java.lang.Object) for int, char and other primitive types.
String is not a primitive type and it very much extends java.lang.Object.
Thanks for the correction on String. I knew there were 8 in total so the other three I missed were short, boolean, and byte. Good question on the protected modifier. Perhaps they only want these methods to be called by objects and not the primitives.
Originally posted by Jitender Kumar: Are there any classes which donot extend java.lang.Object? If not, why are the methods in Object made protected instead of public? ...
Good question! Indeed, all classes extend Object.
Two methods in Object (clone and finalize) have protected access. To understand why, see "using a trick with protected" from Appendix A in Bruce Eckel's Thinking in Java.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
I have to assume you're studying for your SCJP exam - cool! In this thread I think you have some of your Java definitions a little sideways...ya wanna take another shot at your answers? I'm asking because we wouldn't want all the lurkers out there to be getting the wrong impression of how Java works
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth