Hey still learning myself but the four basic methods you need are
public int add(int num1, int num2)
return num1 + num2;
public int subtract(int num1, int num2)
return num1 - num2;
public int multiply(int num1, int num2)
return num1 * num2;
public int divide(int num1, int num2)
return num1 / num2;
now, actually, that's not as much a problem.
there are several ways you can do this.
the first is to use + - * / = as separators, and use the indexOf and substring method of string objects to get the numerical values.
an other way is to, char by char, extract the contents of the string and make a check eacht time whether or not the char is one of the separators.
what have you done yourself so far? it's better to try and fail, than to copy paste.
Very much thanks.....
I also believe better to try and fail than to copy paste but actually
am beginner in java(specially in such type of problems )..So please sir elaborate little bit more so that i could try and apply the concept myself..