This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java -cs AClass a b c

 
Gaurav Goyal
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13974
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure but it is not currently suppported.
 
Jane Griscti
Ranch Hand
Posts: 3141
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to my javac.exe, -cs is "no longer supported".
 
srinivas bolloju
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic