
how to add 2 numbers in java

Hi,
Try this:
class Test{
public int add(int a,int b){
return a+b;
}
public static void main(String []args){
Calculation cal=new Calculation();
int add=cal.add(5,10);
System.out.println(add);
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.