This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have tried various combinations to get integer value corresponding to a system property by executing the public sttatic methods Integer.getInteger(String propertyName) and Long.getLong(String propertyName) but i was not succesfull in getting non-null value.
Please correct me if i am commitiing some mistake in my efforts.Pleaes guide me how can i get this method working ?
Pls. checkout documentation for method public static Integer getInteger(String nm) and tell me the answer. Please also checkout the SCJP1.4 exam objectives. Section 8 ( regarding Fundamental Classes in the java.lang Package ) contains reference to method getXxx(). Please tell me what is that.
[George]: Well. Since you already know that there is a documentation you can check it fo method getInteger(String) and see that there is Since 1.5 mark. As you can guess it is out of scope of SCJP 1.4
Ummmm... no. There is no "since 1.5" on this method. Integer.getInteger() methods have been in the Integer class since the beginning. They are part of the SCJP 1.4 objectives - though not the objectives for 1.2 or 5.0.
By getXxx () in objectives they mean method getInteger() without parameters.
No, they don't. There is no getInteger() with no parameters. There are three overloaded versions of this method, but none with no parameters. Actually the 1.4 objectives don't use parentheses at all here. However many of us will include empty parens when discussing a method (even if there's not really a no-argument version of the method) because it seems useful to provide a visual indicator that we're talking about a method, but we don't want to get bogged down in naming all the parameters, especially if there are several overloads. Perhaps in these cases it would be more useful to say something like getInteger(*) rather than just getInteger(). Regardless, the practice of omitting method arguments in casual conversation is fairly widespread, and something to beware of.
Lalit, when they refer to getXxx, the Xxx is intended to represent a general pattern, which may be replaced with many different things. When the 1.4 objectives refer to the getXxx methods of wrapper classes, they mean any methods beginning with "get" found in the wrapper classes. These include:
I also think the behavior of the methods is rather poor. Returning null for either a missing property or a parsing error makes these methods unnecessarily difficult to debug.
Not that this is EFH's fault of course, I just wanted to complain to someone. [ August 08, 2005: Message edited by: Jim Yingst ]
Joined: Feb 18, 2005
Duh... Some kind of eclipse was on me Now I look in javadocs and cannot get why I was thinking so...
Joined: Jun 20, 2005
Thanks to everyone involved in relieving some of my tension specially Bert Bates(post dated 4-Aug-2003), Jim Yingst , Ernest Friedman-Hill , and George. I was trying to visualise output of every method specified by SCJp1.4 Exam objective that was difficult to grasp theortically. I will find out its working after i clear my SCJP1.4 exam.