no we can't used this char '+' for operation to perform this for addition but if still you want to add then
switch(operator){
case '+':
return a+b;
break;
case '*':
return a*b;
break;
...
Well, the switch statement is exactoy what I wanted to skip. And as I was told that javascript could to it, I thoght that Java should be able to too. Oh well..
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.