Program 2 : Getting Values from user on Command line Window.

Program : 
Create a Java Program that Get Values from user on Command line Window.

Solution :

  1. Here First we are displaying all the values which are entered by the user on command line window.

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


O/P:

>javac SabTech.java
>java SabTech Sabarmati Technology 123

Argument 0 is ==> Sabarmati
Argument 1 is ==> Technology
Argument 2 is ==> 123

Comments

Popular posts from this blog

Part 1: Introduction to Bigdata

Maths for Machine Learning

Good news for SAP Developers, SAP not cutting jobs in India but Creating more Jobs in India.