Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Rufus Williams   on Apr 26 In Java Category.

  
Question Answered By: Leonard Pierce   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.

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

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


Tagged: