public static void main(String[] args)
I know conventionally the main function takes in a parameter args that contains the supplied command line arguments as an array of String objects.
String[] args
. Why not a String
or an array of Integer
? main
function, please provide an example. Answer to your question: NO
Details:
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html
The java command starts a Java application. It does this by starting a Java runtime environment, loading a specified class, and calling that class's main method.
The method must be declared public and static, it must not return any value, and it must accept a String array as a parameter. The method declaration has the following form:
public static void main(String[] args)