Hi There is an error in the question #332 in the Round Up. The system will not exit on System.exit(), infact the code won't compile because there is no System.exit() method with no parameters. Regards Jimi
Art Metzer
Ranch Hand
Joined: Oct 31, 2000
Posts: 241
posted
0
Strictly speaking, Jimih, you are correct. However, in non-JVM settings, empty parentheses after an identifier merely specify that the identifier is a method (as opposed to a variable, class or label), and not necessarily that that method has no arguments. For example, at one of Sun's very own Web sites ( http://java.sun.com/docs/books/tutorial/essential/system/securityIntro.html ), I found the following quote:
For example, the System.exit() method, which terminates the Java interpreter, uses the security manager's checkExit() method to approve the exit operation:
This slapdash application of rules may concern you, Jimih, but it's the way the industry writes, for better or worse. It's all about context. I suppose the Round-Up game could have phrased its question using System.exit( int status ), but why? Now if "System.exit()" is in a snippet of code without an argument, you've definitely got a valid beef. Good luck, Art [This message has been edited by Art Metzer (edited May 21, 2001).]
Jimi Svedenholm
Ranch Hand
Joined: May 19, 2001
Posts: 53
posted
0
ah, ok... I guess I just assumed that line should have been looked upon as one line of code, taken from a java-file... Thanks for the reply. Regards Jimi [This message has been edited by jimih (edited May 21, 2001).]
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
"jimih", The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements. Thanks.