Hello guys
I'm a Java beginner. I just learned class access controls and whatnot, and I wanted to make a class that I called "Calculus" that has different methods for calculus (addition, multiplication etc). I want the arguments of my methods to handle any type, so I have to use Object (no?). With this, i cannot perform any operation on the arguments. here is an example :
public class calculus { public Object add(Object x, Object y) { return x+y; } }
I get this error message : Bad Operand types for binary operator '+'
can anybody help?
P.S, i don't know if there is already a class in the standard java package that has the methods that i'm writing.