| Author |
What's so special with " * "????
|
rob javier
Greenhorn
Joined: Oct 20, 2002
Posts: 9
|
|
i passed as an argument the symbol " * ". but when i tried to print it, i got this: arcldr.exe arcsetup.exe AUTOEXEC.BAT btw, my code is as simple as this: class Ops{ public static void main(String args[]){ System.out.println(args[0]); System.out.println(args[1]); System.out.println(args[2]); } }
|
 |
Mani Ram
Ranch Hand
Joined: Mar 11, 2002
Posts: 1140
|
|
Yes. This happens because the Operating System treats * as a wild character. Java can do nothing about it If you want to pass * as a command line argument, enclose it in quotes Example: java MyClass "*" It will work for Windows. I think it should work in UNIX also. If it doesn't work, try the escape characters (Example: java MyClass \*)
|
Mani
Quaerendo Invenietis
|
 |
rob javier
Greenhorn
Joined: Oct 20, 2002
Posts: 9
|
|
thanks
|
 |
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
|
|
|
Moving this to Java in General (Beginner) forum.
|
SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
|
 |
 |
|
|
subject: What's so special with " * "????
|
|
|