This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hello everybody. Can anyone explain what are public static Integer getInteger(String nm) public static Integer getInteger(String nm, int val) for? In Java 2 SDK, Standard Edition Documentation I have read this: getInteger determines the integer value of the system property with the specified name. If there is no property with the specified name, if the specified name is empty or null, or if the property does not have the correct numeric format, then null is returned. I have tested on my computer (OS -Windows 98) this program: import java.util.*; class Test { public static void main(String[] args) { Properties prop = new Properties(); prop = System.getProperties(); for(Enumeration enum = prop.propertyNames(); enum.hasMoreElements(); ) { System.out.println(Integer.getInteger((String)enum.nextElement())); } } } The result was a list of null-s. So if all integer value of the system property are null what are getInteger for? Thank you very much. :roll: [ October 02, 2002: Message edited by: ArthurClarke ] [ October 02, 2002: Message edited by: ArthurClarke ] [ October 02, 2002: Message edited by: Arthur Clarke ] [ October 02, 2002: Message edited by: Arthur Clarke ]
ArthurClarke, Welcome to Javaranch We'd like you to read the Javaranch Naming Policy and change your publicly displayed name (change it here) to comply with our unique rule. Thank you. PS: Quote from the naming policy:
For your publicly displayed name, use a first name, a space, and a last name. Obviously fictitious names or improperly formatted names may be locked out.
PS: Adding a space between Arthur and Clarke would be perfect