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
  • 72,938
  • 12
  • 79
  • 109

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
  • 374,785
  • 51
  • 663
  • 734