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.
I think it is very unnecessary to check if it fits into long. We have x variable in long datatype in the beginning, and also if it fits byte, short and int all the way, it'll definitely fit in long. So you can just print that it fits into long, without checking.
P.S. Why doesn't HackerRank have code formatting?..
Java Datatypes
You are viewing a single comment's thread. Return to all comments →
I think it is very unnecessary to check if it fits into long. We have x variable in long datatype in the beginning, and also if it fits byte, short and int all the way, it'll definitely fit in long. So you can just print that it fits into long, without checking.
P.S. Why doesn't HackerRank have code formatting?..