Linked Questions
67 questions linked to/from What is the "String[] args" parameter in the main method?
55 votes
8 answers
472k views
Explanation of 'String args[]' and static in 'public static void main(String[] args)' [duplicate]
How can you explain very well, to a beginner, the meaning of String args[] and the use of static in the following excerpt? class FirstApp { public static void main(String[] args) { ... ...
2 votes
7 answers
28k views
What does (String[] arguments) mean? [duplicate]
I added the following code to a new class I created in Java: public static void main(String[] arguments) { I understand what public, static and void mean, but what does (String[] arguments) mean?
2 votes
5 answers
7k views
can we change the main method of java? [duplicate]
Main method in Java have the String[] as input parameter to the main method, but i want to pass object as a parameter. Java and all command line parametrized languages accept only String array of ...
0 votes
5 answers
12k views
what is the use of string args[] in main method [duplicate]
Possible Duplicate: What is “String args[]”? in Java What is the purpose of this method in java. If we not use what happens? If i give some array size then what happens
-2 votes
2 answers
14k views
how to accept values using command line argument in java [duplicate]
Possible Duplicate: What is “String args[]”? in Java How do you accept values using command line argument in java? Whenever I try to do it, it shows Exception in thread "main" java.lang....
-4 votes
2 answers
13k views
What is args ? and When would you use args? [duplicate]
public static void main(String[] args) What is String[] args? When would you use args?
0 votes
3 answers
2k views
Does "args" have to be included in the main method? [duplicate]
In the standard public static void main(String[] args), I have noticed that (at least in Dr. Java), you can use other words besides args, but I have never seen any code that does deviate from this ...
0 votes
3 answers
10k views
What is in argv? [duplicate]
public static void main(String[] argv) { Connection connection = DatabaseDriverExtender.connectOrCreateDataBase(); if (connection == null) { System.out.print("NOOO"); } ...
-5 votes
4 answers
7k views
purpose of String args[] in main method in java [duplicate]
In java main method, what's the purpose of String args[] in public static void main (String args[]) ?
2 votes
2 answers
707 views
Understanding (string args[]) [duplicate]
Possible Duplicate: What is “String args[]”? in Java So I recently (well, three days ago) started teaching myself Java, with absolutely zero previous programming experience unless you count HTML/...
-2 votes
2 answers
730 views
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at Calculator.main(Calculator.java:25) [duplicate]
I wrote this code for a simple calculator and I get this error! Someone help me please! public class Calculator { public static void main (String[] args) { int num1 = Integer.parseInt(args[0]...
-1 votes
2 answers
405 views
What is exactly args and how do i used it? [duplicate]
I am a new programer and I'm just starting to learn the basics of Java and I'm trying to understand what exactly "args" stands for in "public static void main(String[] args)". I ...
0 votes
1 answer
618 views
Index 0 out of bounds for length 0 java [duplicate]
Hello how do I change it so I don't get the error mentioned above? I don't know how to add or declare args[0] before. public class DN02 { public static void main(String[] args) { if (args[...
-2 votes
1 answer
425 views
How can I change my code to accept user inputs [duplicate]
I have working code that encrypts a phrase using a caesar cipher but this is with predetermined inputs (HELLOWORLD and 4 as the sift). What I would like to do is enable a user to choose their own ...
0 votes
1 answer
156 views
unable to figure out the concept of command line arguments in Java [duplicate]
public class CommandArgsThree { public static void main(String [] args) { String [][] argCopy = new String[2][2]; int x; argCopy[0] = args; x = argCopy[0]....