sum of two numbers
843785Mar 20 2009 — edited Mar 20 2009hi,
i wrote the java programme to add two numbers as a userinterface when iam compile it iam getting two errors.which are like this " constructor Sum(java.lang.String)"where iam going wrong could you tell me please.
my prog. is like this.
class Sum
{
int a,b,c;
void add(int x,int y)
{
a=x;
b=y;
c=x+y;
System.out.println("The sum of"+x+"&"+y+"is "+c);
}
}
class SumDemo
{
public static void main(String[] args)
{
if(args.length==0)
{
System.out.println("Plz Pass the Data");
}
else
{
Sum so=new Sum(args);
int x=Integer.parseInt(args[0]);
int y=Integer.parseInt(args[1]);
so.add(x,y);
}
}
}