File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ranch Office and the fly likes Error in Round Up (#332) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » This Site » Ranch Office
Reply Bookmark "Error in Round Up (#332)" Watch "Error in Round Up (#332)" New topic
Author

Error in Round Up (#332)

Jimi Svedenholm
Ranch Hand

Joined: May 19, 2001
Posts: 53
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
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
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
"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.

A Convergent Visionary ~ Frank's Punchbarrel Blog ~ LinkedIn profile
 
 
subject: Error in Round Up (#332)
 
Threads others viewed
Exiting a program through a switch
TeckChek Java 2 Test
compare variables of an object
Populate an array with given values
Exception in thread "main" java.io.IOException: Too many open files
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com