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.
Ahh that's how you access the MAX_VALUE and MIN_VALUE constants. Thanks.
Just a note, you could remove if (x >= Long.MIN_VALUE && x <= Long.MAX_VALUE). x has to be a long by definition so we don't have to check it.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Datatypes
You are viewing a single comment's thread. Return to all comments →
Ahh that's how you access the MAX_VALUE and MIN_VALUE constants. Thanks. Just a note, you could remove
if (x >= Long.MIN_VALUE && x <= Long.MAX_VALUE)
.x
has to be along
by definition so we don't have to check it.