Skip to content

Commit ee77cb0

Browse files
authored
Update StaticNullMagic.java
1 parent 2e505de commit ee77cb0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

BasicJava/src/trick/StaticNullMagic.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@ public static void main(String[] args) {
2424

2525
Abc a = null;
2626
a.staticMethod();
27+
28+
// Check which statement will give you complie time error
29+
Integer i = new Integer(null);
30+
String s = new String(null);
2731
}
2832
}

0 commit comments

Comments
 (0)