[Solved] Don’t understand the usage thing in java


The String args[] parameter of your main method is an array of Strings which indexes can be filled when you’re executing your program from the command line.

Here is how to do it in from your command line :

javac GuessingGame.java // This will compile your Java code file
java GuessingGame one two three // Here, we execute the bytecode file created from compilation

The value of String[] args here is the following :

["one", "two", "three"]

MORE INFO

PS : I do not know any method to have a filled String[] args from an IDE. It is empty by default.

2

solved Don’t understand the usage thing in java