0
[DUPLICATE] public static void main (String args[])Â , public static void main (String[] args)Â . ....Which one is correct..?
7 Answers
+ 6
The square brackets belong on String[].
In all honesty, you don't need to use String[] args for most projects you'll be coding. You can safely remove it.
+ 6
You're welcome! ^_^ Always good to ask, when you're just starting off.
+ 5
Oh, whoops, didn't know that. :/ I'm not too familiar with Java yet...
+ 3
first at all everything depends in which language you are working, and as the another partner seid before, you can delete that with no problems, and anything gonna happen, but you could use it to set some argument since the begining of the compiling for example:
public static void Main(string[] args ){
for(int k=0; k<args.Leght; k++){
Console.WriteLine(arg[k]);
}
}
/*as you can see if you set since the begining of the compilation some dates, you will get some things seted before, remenber how a program works*/
+ 1
@michael, you are right, if he were using C#, and @Tamra, String[] args cannot be removed, because main() is never called, but main(String[] args) is called directly from the JVM
0
im beginner
that why it's creating problem
thank u so much for ur valuable suggestion
0
Number 2!



