My Anna

Indias Biggest Engineering Education Community Enriching Students Minds with Latest Placement Papers, Study Materials, Fresher Jobs and Free E Books

A Unit of Aim Clear Technologies Ltd.
Search Study Materials, Jobs, Placement Papers, Interview Tips, Training Videos & More

Advertise with us

Who is online



Post new topic Reply to topic  [ 1 post ] 

mkalaiyarasan
As a Family
As a Family
User avatar

Joined:
Tue Aug 25, 2009 5:25 pm
Beans: 35
In Bank: 0
College: studied
Degree: BE
Department: cse
State: Tamilnadu
Fav Quote: cse
Position: Employee
 
#2
Fri Aug 28, 2009 4:19 pm
Post subject: Command line arguments Post
class PrintArgs {

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

}

}
The name of the class is not included in the argument list.
Command line arguments are passed in an array of Strings. The first array component is the zeroth.
For example, consider this invocation:
$ java printArgs Hello There
args[0] is the string "Hello". args[1] is the string "There". args.length is 2.
All command line arguments are passed as String values, never as numbers. Later you'll learn how to convert Strings to numbers.

Profile E-mail
Offline

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 
Bookmark & Share

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB Group.

phpBB SEO