Main Method Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kid Programmer
    New Member
    • Mar 2008
    • 176

    #1

    Main Method Question

    Hello guys. I have a question about the main method of a program. Is there any difference between typing
    Code:
    public static void main(String[] args) {
    and typing
    Code:
    public static void main(String args[])
    Thanks.
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    Originally posted by Kid Programmer
    Hello guys. I have a question about the main method of a program. Is there any difference between typing
    Code:
    public static void main(String[] args) {
    and typing
    Code:
    public static void main(String args[])
    Thanks.
    There is no difference. The first way is generally preferred.

    Comment

    • Kid Programmer
      New Member
      • Mar 2008
      • 176

      #3
      Originally posted by BigDaddyLH
      There is no difference. The first way is generally preferred.
      Thanks I understand.

      Comment

      • BigDaddyLH
        Recognized Expert Top Contributor
        • Dec 2007
        • 1216

        #4
        Originally posted by Kid Programmer
        Thanks I understand.
        Pop quiz: are these the same?

        [CODE=Java]int []a, b;

        int a[], b;[/CODE]

        Comment

        Working...