I'm writing a math class. It has a bunch of methods in it, some are quite long. My constructor and methods only accept an int as a parameter right now. I want to extend this to include long's and BigInteger's and in some cases double's. But I don't want to have to rewrite every method for each data type. I tried a bunch of things, including generics, but I kept running into incomparable type problems when i started trying to operate on the variables even after I cast them as a specific datatype. My prof said it would be possible using generics but I cant seem to get it to work. Has anyone ran across this problem before?