1 parent c7d897f commit 757ac5aCopy full SHA for 757ac5a
1 file changed
src/Main.java
@@ -12,5 +12,12 @@ public static void main(String[] args) {
12
// Object.equals will check for null
13
System.out.println("person equal null: " + Objects.equals(p1, null));
14
System.out.println("both person equal: " + Objects.equals(p1, p2));
15
+
16
+ // this will error out. will have to compare will null as below
17
+ // have mixed feelings about this.
18
+ // if (null) System.out.println("null is true");
19
20
+ // this works
21
+ if (null == null) System.out.println("null is true");
22
}
23
0 commit comments