Results 1 to 5 of 5
  1. #1
    boblingwide is offline Member
    Join Date
    Mar 2012
    Posts
    15
    Rep Power
    0

    Default Q?> about public static void main(String args[])

    what is the diference in

    1. public static void main(String args[])
    2. public static void main(String[] args)

    explain each diference and whats is the proper codings of this?

    in java tutorials i always incounter "public static void main(String args[])"

    than "public static void main(String[] args)"..

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default Re: Q?> about public static void main(String args[])

    Both notatations have the same meaning; the first notation only exist not to scare of the C/C++ programmers. The second form is the 'Java way'.

    kind regards,

    os
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    boblingwide is offline Member
    Join Date
    Mar 2012
    Posts
    15
    Rep Power
    0

    Default Re: Q?> about public static void main(String args[])

    Quote Originally Posted by JosAH View Post
    Both notatations have the same meaning; the first notation only exist not to scare of the C/C++ programmers. The second form is the 'Java way'.

    kind regards,

    os
    Q1> so any of the two is working properly in the long run? no erors in the two?

    Q2> why i incounter always the "public static void main(String args[])" using java?

    Q3> so if im using java, ur advice is always use the "public static void main(String[] args)" for java way?
    Last edited by boblingwide; 03-23-2012 at 10:41 AM. Reason: wrong speling

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default Re: Q?> about public static void main(String args[])

    Quote Originally Posted by boblingwide View Post
    Q1> so any of the two is working properly in the long run? no erors in the two?

    Q2> why i incounter always the "public static void main(String args[])" using java?

    Q3> so if im using java, ur advice is always use the "public static void main(String[] args)" for java way?
    Which part of "the same meaning" didn't you understand? C/C++ infected people prefer the C-way, others like the Java way.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    boblingwide is offline Member
    Join Date
    Mar 2012
    Posts
    15
    Rep Power
    0

    Default Re: Q?> about public static void main(String args[])

    Quote Originally Posted by JosAH View Post
    Which part of "the same meaning" didn't you understand? C/C++ infected people prefer the C-way, others like the Java way.

    kind regards,

    Jos
    ahh ok tnx! im a java man, so il go to java way hehehe

Similar Threads

  1. Replies: 10
    Last Post: 07-10-2011, 08:37 AM
  2. What wrong with it?case : public static void main
    By bytescode in forum New To Java
    Replies: 7
    Last Post: 02-10-2011, 07:01 AM
  3. Public static void main (String args[])
    By arefeh in forum New To Java
    Replies: 12
    Last Post: 01-28-2010, 11:58 AM
  4. Replies: 9
    Last Post: 11-22-2008, 11:03 PM
  5. Replies: 5
    Last Post: 10-06-2008, 12:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •