aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes java -cs AClass a b c Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "java -cs AClass a b c " Watch "java -cs AClass a b c " New topic
Author

java -cs AClass a b c

Gaurav Goyal
Greenhorn

Joined: Jul 04, 2001
Posts: 20
if a compiled class is executed with the following option:
java -cs AClass a b c
Which statement is true?

A.args[0]="-cs";
B.args[1]="a b c";
C.args[0]="java";
D.args[0]="a";
E.args[1]='b';
Ans = d
could u people plz explain what is this option, and how is it effecting the result
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
I am not sure but it is not currently suppported.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi Gaurav,
There is no '-cs' option for 'java.exe' They may have meant to type '-cp'. Anyway, I think they threw it in just to confuse the issue Some other languages store the name of the file used to start the application at args[0]. The questions a trick to make sure you understand tha Java only stores the actual arguments in args[].
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
According to my javac.exe, -cs is "no longer supported".
srinivas bolloju
Ranch Hand

Joined: Jan 23, 2001
Posts: 112
hi gaurav,
cp -sets search path for application classes and resources,
i dont know whether it is in usage now,
i have a class called arrayini...do this on ur cmd prompt and see what happens....
C:\bjava\array>java -cp arrayini
Usage: java [-options] class [args...]
(to execute a class)
or java -jar [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath <directories and zip/jar files separated by ;>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-? -help print this help message
-X print help on non-standard options


please use the [code][/code] tags when showing code. visit <a href="http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=ubb_code_page" target="_blank" rel="nofollow">http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=ubb_code_page</a> ,for more details
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Originally posted by srinivas bolloju:
cp -sets search path for application classes and resources,
i dont know whether it is in usage now,
-cp is still a valid command
 
wood burning stoves
 
subject: java -cs AClass a b c