Link Details

Link 861117 thumbnail
User 1071287 avatar

By dinesh.varyani
via hubberspot.com
Published: Oct 10 2012 / 08:41

Introduction :- Hello friends, having question in mind, How to use Command-Line Arguments in Java ?. In this hub I will be teaching you how to utilize java command-line utilities?. Learning Java by example is the most effective proven technique. Java fundamentals are necessary in order to get an idea for writing a efficient code. Our program code in this hub will require Java's basic knowledge such as : How to write your first Java program ?. and how to create, compile and run a java program ?. Command-Line Argument Explanation :- A normal Java application before running, can accept multiple command line arguments from the programmer via console or IDE runtime configuration. The arguments are specified by the user at the command line which are required by the Java applications. The user enters command line arguments while launching the program by java command. This passing of arguments by java command is optional. The main method gets arguments from command line and stores it in an array of String. The array elements are initialized by whatever user types after class-name in java command. Let us take an example, suppose we want to launch a class say Hubpages.java with command line arguments, we type command after compilation as :
  • 3
  • 0
  • 414
  • 452

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (3)



Voters Against This Link (0)



    Spring Integration
    Written by: Soby Chacko
    Featured Refcardz: Top Refcardz:
    1. Search Patterns
    2. Python
    3. C++
    4. Design Patterns
    5. OO JS
    1. PhoneGap
    2. Spring Integration
    3. Regex
    4. Git
    5. Java