Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Argument through command line

  Asked By: Rufus    Date: Apr 26    Category: Java    Views: 771
  

i have written a simple program which are taking
argument through command line ,but when i am trying to run a file it
simply run a file without taking input .Please help me out ,i am using
netBeans 5.5 IDE and jdk 1.5.

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Bernard Gutierrez     Answered On: Apr 26

would u tell us how u r executing the program???
and if possible send us the code also..

 
Answer #2    Answered By: Vilhelm Fischer     Answered On: Apr 26

While running the program  using command  line did you mentioned the argument
like this...

 
Answer #3    Answered By: Kyle Fox     Answered On: Apr 26

i want the complte program.so that i can compile u r pgm and
send u r problem

 
Answer #4    Answered By: Leonard Pierce     Answered On: Apr 26

here is a simple  example

//file myclass.java
//source code

class myclass{
public static void main (String params[]){
for (int i=0; i< params.length; i++){
System.out.println(params[i]);
}
}
}

//compile
> javac myclass.java

//no errors of course cuz i wrote it ;-)
//Call it from command  line as:
> java myclass first-arg second-arg third-arg

//output looks like
first-arg
second-arg
third-arg


Make this example and then make ur code something like it.

 
Answer #5    Answered By: Elisabeth Bell     Answered On: Apr 26

this type of programe are not available with use of netbean5.5

 
Answer #6    Answered By: Midissia Lopez     Answered On: Apr 26

while running put java <file Name> <letters to be print> press enter

 
Didn't find what you were looking for? Find more on Argument through command line Or get search suggestion and latest updates.




Tagged: