22:28

command line arguments

Posted by Mitesh Patel |

/*
java program to show how to get value from use
with the use of "command line arguments"
*/

class CLA
{
    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));
       
    }
}

0 comments:

Post a Comment

Subscribe