2
class Fox{

    long phone_number;

    public Fox(long num){
        this.phone_number = num;
    }
}
public class Box{
    public static void main(String[] args){
        Fox object = new Fox(88888888888888888);
        System.out.println(object.phone_number);
    }

}
fabian
  • 80,457
  • 12
  • 86
  • 114

1 Answers1

4

88888888888888888 is an int literal (that's the default type for integral literals when no suffix is specified), and it's too large for an int. Use 88888888888888888L or 88888888888888888l for a long literal.

Eran
  • 387,369
  • 54
  • 702
  • 768