-
Emphasis on Code Reuse
if(number > maxValue) ...
is used in multiple places. Can be taken to one place -
Exception
is generic. Instead we can throwIllegalArguemntException
-
Being consistant. All the places Exceptions are thrown. Only in one place
System.err.print
is used. Better to throw exception there too