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.
- Prepare
- Java
- Introduction
- Java Datatypes
- Discussions
Java Datatypes
Java Datatypes
Sort by
recency
|
1441 Discussions
|
Please Login in order to post a comment
I am not sure why the below didn't work? The output for the below is
-150 can be fitted in: * int * long 150000 can be fitted in: * int * long 1500000000 can be fitted in: 213333333333333333333333333333333333 can't be fitted anywhere. -100000000000000 can be fitted in:
import java.util.; import java.io.;
class Solution{ public static void main(String []argh) {
}
Complete solution in this website for this question. Java Datatypes-hacker-rank-solution
(https://digitwood.com/java-datatypes-hacker-rank-solution-digit-wood/)
import java.util.; import java.io.;
class Solution{ public static void main(String []argh) {
}
// my code
import java.math.BigInteger; import java.util.Scanner;
public class Solution {
}
You don't have to check if a number is a Long type because if it wasn't, an exception would've been catched already.