Skip to content

Commit ade1d5e

Browse files
committed
Further Updates prior to releasing Version 2.0 of book
1 parent 7bf3a4c commit ade1d5e

15 files changed

+46
-100097
lines changed

collections/ApplesAndOrangesWithoutGenerics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static void main(String[] args) {
2424
apples.add(new Orange());
2525
for(Object apple : apples) {
2626
((Apple) apple).id();
27-
// Orange is detected only at run time
27+
// Orange is detected only at runtime
2828
}
2929
}
3030
}

collections/AsListInference.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,23 @@ public static void main(String[] args) {
1616
List<Snow> snow1 = Arrays.asList(
1717
new Crusty(), new Slush(), new Powder());
1818
//- snow1.add(new Heavy()); // Exception
19+
//- snow1.remove(0); // Exception
1920

2021
List<Snow> snow2 = Arrays.asList(
2122
new Light(), new Heavy());
2223
//- snow2.add(new Slush()); // Exception
24+
//- snow2.remove(0); // Exception
2325

2426
List<Snow> snow3 = new ArrayList<>();
2527
Collections.addAll(snow3,
2628
new Light(), new Heavy(), new Powder());
2729
snow3.add(new Crusty());
30+
snow3.remove(0);
2831

2932
// Hint with explicit type argument specification:
3033
List<Snow> snow4 = Arrays.<Snow>asList(
3134
new Light(), new Heavy(), new Slush());
3235
//- snow4.add(new Powder()); // Exception
36+
//- snow4.remove(0); // Exception
3337
}
3438
}

concurrent/PSP2.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)