Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 334 Bytes

File metadata and controls

22 lines (18 loc) · 334 Bytes

Integer

The type to use for an int that might be null is Integer.

~void main() {
Integer i = null;
IO.println(i);
i = 5;
IO.println(i);
~}

If you try to do any math on an Integer which holds null you will get a NullPointerException.

~void main() {
Integer i = null;
IO.println(i * 5);
~}