Results 1 to 4 of 4

Thread: is this run

  1. #1
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Posts
    162
    Rep Power
    6

    Default is this run

    hi
    sorry for the funny question
    class Test{

    public static void main (String... args) {
    System.out.println("ddddddddddddddddddd"+args[0]);

    }

    }
    does this complie and run and how there is String....

    y the compiler is not showing any error.

    thank you

  2. #2
    dswastik is offline Senior Member
    Join Date
    Dec 2008
    Location
    Kolkata
    Posts
    283
    Rep Power
    7

  3. #3
    dswastik is offline Senior Member
    Join Date
    Dec 2008
    Location
    Kolkata
    Posts
    283
    Rep Power
    7

    Default

    String...arg itself forms an array of String of unknown number of elements i.e. same as arg[]
    Swastik

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by javastuden View Post
    y the compiler is not showing any error.
    As dswastik says, it's a new feature introduce with the Java 5. Both ways are valid, and you didn't comes with an error.

Posting Permissions

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