Q:

Integer number too large

Hi I'm having trouble understanding why this isn't working
if(Long.parseLong(morse) == 4545454545){
     System.out.println("2");
}

Where morse is just a String of numbers. The problem is it says Integer number too large: 4545454545, but I'm sure a Long can be much longer than that.

A:

You need to use 4545454545l or 4545454545L to qualify it as long. Be default , 4545454545 is an int literal and 4545454545 is out of range of int.
It is recommended to use uppercase alphabet L to avoid confusion , as l and 1 looks pretty similar
You can do :
if(Long.valueOf(4545454545l).equals(Long.parseLong(morse)) ){
     System.out.println("2");
}

OR
if(Long.parseLong(morse) == 4545454545l){
   System.out.println("2");
}

As per JLS 3.10.1:

An integer literal is of type long if it is suffixed with an ASCII letter L or l (ell); otherwise it is of type int (§4.2.1).

A:

If your integer value is larger than 2147483647, as your literal is then you need to use a long literal:
4545454545L
...note the L at the end, which is the difference between a long and an int literal. A lower case l works too, but is less readable as it's easily confused with a 1 (not a great thing when you're dealing with a number!)

