Java's args.length

if I give *  as a an argument in command line for a java program, why args.length returns 268? and not 1
ex:
java myProgram *
args.length returns 268??? and not 1

can any body tell me ???? please

I use 1.2beta3 JDK on Windows 95
hvhemantAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
msmolyakConnect With a Mentor Commented:
Apparently asterisk gets treatead as a wild card so the args array gets populated with the names of the files matching the pattern. I am not sure whether it is a standard feature of JVM. I tried the same in Symantec and it does not seem to do it.

If you want to pass an asterisk, use "*".
0
 
msmolyakCommented:
Can't see why it should. Could you supply a code sample.
0
 
hvhemantAuthor Commented:
msmolyak,
here is the simple code

class Test{
   public static void main(String args[]){
      System.out.println(args.length());
    }
}
0
 
hvhemantAuthor Commented:
msmolyak,
     here is the simple code please ignore the above sample code.

class Test{
        public static void main(String args[]){
           System.out.println(args.length);
         }
     }
0
 
hvhemantAuthor Commented:
Edited text of question
0
All Courses

From novice to tech pro — start learning today.