Public static void main( String[] args) and public static void main (String args[])

Status
Not open for further replies.

bjerkely

Member level 4
Joined
May 26, 2004
Messages
72
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
Turkiye
Activity points
589
Hi friends,

Can you explain what is the difference between
public static void main( String[] args)
and public static void main(String args[])
My program prints out the parameters typed by the user but it seems they both work.

regards,
 

Re: JAVA beginner

hi,
these are 2 way that Java allow user to declare main method and both work.But we should declare as the first way String[] args because it is encouraged.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…