It seems this is one way to have a return status code
from your main
.
but I am wondering where does this int
go? I tried it on eclipse, But I do not see it on console.
how do I get the status code
public static void main(String[] args){
int status = 123;
System.exit(status);
}
That value is known as the exit status
Here's a little Java test to demonstrate it
compile and run this program without any arguments. It will print
This java program starts a child process. When that process ends, it returns the value that was passed to it in
System.exit(?)
to its parent process which it then prints out.