0
why string is used in main function parameters
public static void main( String[] at)
3 Réponses
0
"Strings, which are widely used in Javaprogramming, are a sequence of characters. In the Java programming language, strings are objects. TheJava platform provides the Stringclass to create and manipulatestrings." (google) its hard to explain in my own words
0
To accept arguments from the command line. If you ran your program in CMD for example, you'd do javac Program.java, then java Program "Turtle"
To call the string in your program, you just use the parameter name and index. public static void main(String[] parameters)
System.out.println(parameters[0]);
Normally they are called args in main method just fyi.
0
to read the command line arguments