Closed kykungz closed 6 years ago
max and min should be an int, not Integer. These two types are interchangeable but Integer is an object which consumes more memory space than an int which is primitive. https://github.com/OOP2018/guessing-game-SupalukBenz/blob/4751f8f9d199f4406408789e256052ffbca1ac5b/src/GameSolver.java#L20-L21 What you are using (Integer) is an example of a Wrapper class, which has its own use case. See Java wrapper class for more information.
max
min
int
Integer
primitive
max
andmin
should be anint
, notInteger
. These two types are interchangeable butInteger
is an object which consumes more memory space than anint
which isprimitive
. https://github.com/OOP2018/guessing-game-SupalukBenz/blob/4751f8f9d199f4406408789e256052ffbca1ac5b/src/GameSolver.java#L20-L21 What you are using (Integer
) is an example of a Wrapper class, which has its own use case. See Java wrapper class for more information.