Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ede3954

Browse files
committed
March 2021 Book Update
See notes in "Foreword to the Leanpub Edition"
1 parent 129df0b commit ede3954

File tree

155 files changed

+1856
-1217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+1856
-1217
lines changed

collections/AdapterMethodIdiom.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void remove() { // Not implemented
3333
public class AdapterMethodIdiom {
3434
public static void main(String[] args) {
3535
ReversibleArrayList<String> ral =
36-
new ReversibleArrayList<String>(
36+
new ReversibleArrayList<>(
3737
Arrays.asList("To be or not to be".split(" ")));
3838
// Grabs the ordinary iterator via iterator():
3939
for(String s : ral)

collections/CollectionSequence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2021 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
import typeinfo.pets.*;
5+
import reflection.pets.*;
66
import java.util.*;
77

88
public class CollectionSequence

collections/CrossCollectionIteration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2021 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
import typeinfo.pets.*;
5+
import reflection.pets.*;
66
import java.util.*;
77

88
public class CrossCollectionIteration {

collections/CrossCollectionIteration2.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2021 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
import typeinfo.pets.*;
5+
import reflection.pets.*;
66
import java.util.*;
77

88
public class CrossCollectionIteration2 {

collections/InterfaceVsIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2021 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
import typeinfo.pets.*;
5+
import reflection.pets.*;
66
import java.util.*;
77

88
public class InterfaceVsIterator {

collections/LinkedListFeatures.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2021 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
import typeinfo.pets.*;
5+
import reflection.pets.*;
66
import java.util.*;
77

88
public class LinkedListFeatures {

collections/ListFeatures.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2021 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
import typeinfo.pets.*;
5+
import reflection.pets.*;
66
import java.util.*;
77

88
public class ListFeatures {

collections/ListIteration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2021 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
import typeinfo.pets.*;
5+
import reflection.pets.*;
66
import java.util.*;
77

88
public class ListIteration {

collections/MapOfList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Visit http://OnJava8.com for more book information.
55
// {java collections.MapOfList}
66
package collections;
7-
import typeinfo.pets.*;
7+
import reflection.pets.*;
88
import java.util.*;
99

1010
public class MapOfList {

collections/MultiIterableClass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public Iterable<String> randomized() {
2929
return new Iterable<String>() {
3030
public Iterator<String> iterator() {
3131
List<String> shuffled =
32-
new ArrayList<String>(Arrays.asList(words));
32+
new ArrayList<>(Arrays.asList(words));
3333
Collections.shuffle(shuffled, new Random(47));
3434
return shuffled.iterator();
3535
}

collections/NonCollectionSequence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2021 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
import typeinfo.pets.*;
5+
import reflection.pets.*;
66
import java.util.*;
77

88
class PetSequence {

collections/PetMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2021 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
import typeinfo.pets.*;
5+
import reflection.pets.*;
66
import java.util.*;
77

88
public class PetMap {

collections/SimpleIteration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2021 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
import typeinfo.pets.*;
5+
import reflection.pets.*;
66
import java.util.*;
77

88
public class SimpleIteration {

collectiontopics/CollectionMethods.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ public static void main(String[] args) {
5656
// c2 and c3 (an intersection of sets):
5757
c2.retainAll(c3);
5858
show(c2);
59-
// Throw away all the elements
60-
// in c2 that also appear in c3:
59+
// Discard all c2 elements that also appear in c3:
6160
c2.removeAll(c3);
6261
System.out.println(
6362
"c2.isEmpty() = " + c2.isEmpty());

0 commit comments

Comments
 (0)