Here's what I've been trying to do, in a nutshell:
class example
{
private int function(T number)
{
int x = (int) number;
...
}
...
}
Basically, I'm trying to make it so that T is a number so I can convert it to an int inside that function. The problem is that I'm getting an "incovertible types" error, so I must be doing something wrong.
解决方案
Considering that the abstract class Number is the superclass of classes
* BigDecimal, BigInteger,
* Byte, Double, Float,
* Integer, Long, and Short...
if you want to have an int representation, you should use the .intValue() function.
If that is what you want to do.