COMMAND LINE ARGUMENT IN JAVA

A java Tutorial

Tech Jitendra provides ,

Discussion about command line argument in Java .

Command line argument in Java

The command line argument is the argument passed to a program at the time when you run it. To access the command-line argument inside a java program is quite easy, they are stored as string in String array passed to the args parameter of main()method.

Exampleclass cmd { public static void main(String[] args) { for(int i=0;i< args.length;i++) { System.out.println(args[i]); } } }Execute this program as java cmd 10 20 30

10 20 30

command line argument

Thanking you

Tech Jitendra .

Published by Tech Jitendra Direct Investing

Tech Jitendra Direct Investing (TJDI) Empoworing Your Wealth

Join the Conversation

  1. Tech Jitendra Direct Investing's avatar

1 Comment

Leave a comment

Design a site like this with WordPress.com
Get started