Example
import java.io.*;
public class A12
{
public static void main(String args[])
{
try
{
int a=Integer.parseInt(args[0]);
int b=Integer.parseInt(args[1]);
System.out.println(" Addition of two number:"+(a+b));
}
catch(Exception e)
{
System.out.println("Enter number to add");
}
}
}
import java.io.*;
public class A12
{
public static void main(String args[])
{
try
{
int a=Integer.parseInt(args[0]);
int b=Integer.parseInt(args[1]);
System.out.println(" Addition of two number:"+(a+b));
}
catch(Exception e)
{
System.out.println("Enter number to add");
}
}
}
No comments:
Post a Comment