Simple Command line Argument program

Simple Command line Argument program

To get values from use you must have to use Wrapper classes

* general work of wrapper classes is that it converts one data types value in to another type

[java]

class Get_Value_From_User {

public static void main(String args[]) {

int x = Integer.valueOf(args[0]);

int y = Integer.valueOf(args[1]);

System.out.println("The sum of values = " + (x+y));
}

}

[/java]

Share

About the Author

Akash Padhiyar

Visit Website

There are no comments yet, add one below.

Leave a Comment

Your email address will not be published. Required fields are marked *

*

Time limit is exhausted. Please reload CAPTCHA.