Advertisement
karlakmkj

Command Line Arguments

Sep 8th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. package commandLineArgs;
  2.  
  3. public class Greeting {
  4.  
  5.     public static void main(String[] args) {
  6.         System.out.println("Hello " + args[0]);
  7.         System.out.println("Hello " + args[1]);
  8.     }
  9. }
  10.  
  11. /* Using command line arguments
  12.  * main method accepts inputs through the String[] args array and uses it to produce output
  13.  * Go to class > Run configurations
  14.  *  > Arguments tab - type values in Program arguments (no comma but type in next line)
  15.  *  > click Apply and Run
  16. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement