We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

Instead of wasting your time and resources doing mathematical calculations, you should just use final static values that are kept in classes. For example classes Byte, Short, Int, Long have final static variables for their MIN_VALUE and MAX_VALUE. So you can write your program like this to make it much more efficient. Don't forget, we are computer engineers. Engineer is a person who solves problem and solved problems efficiently. Solving a problem alone is not engineering.

## Java Datatypes

You are viewing a single comment's thread. Return to all comments →

Instead of wasting your time and resources doing mathematical calculations, you should just use final static values that are kept in classes. For example classes Byte, Short, Int, Long have final static variables for their MIN_VALUE and MAX_VALUE. So you can write your program like this to make it much more efficient. Don't forget, we are computer engineers. Engineer is a person who solves problem and solved problems efficiently. Solving a problem alone is not engineering.

thank you MichaelWittmann this worked, great.