GeekInterview.com
Series: Subject: Topic:
Question: 992 of 995

What is the difference between java command line arguments and C command  line arguments

Asked by: Interview Candidate | Asked on: Jul 16th, 2005
Showing Answers 1 - 4 of 4 Answers
sailaja

Answered On : Jul 6th, 2005

In C and C++, the system passes two arguments to a program: argc and argv. argc specifies the number of arguments stored in argv. argv is a pointer to an array of characters containing the actual arguments. In Java, the system passes a single value to a program: args. args is an array of Strings that contains the command-line arguments.

Yes  2 Users have rated as useful.
  
Login to rate this answer.
amal chacko

Answered On : Jul 16th, 2005

What is the difference between java command line arguments and C command line arguments

  
Login to rate this answer.
Mohan

Answered On : Sep 13th, 2005

In C the argument counter starts from the program name itself.

But in the case of  Java the argument count starts after the classname

for eg: java testArg rao rao1

the arg[0] is "rao " here(in Java )

But in the case of C it comes to "testArg"

 

  
Login to rate this answer.
murali

Answered On : Dec 12th, 2006

 In c,there are argc and argv.argc is passed to argv and argv is used to store characters.in java there is only args.we pass a String value to it.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.