We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0870429 commit 04039c7Copy full SHA for 04039c7
arrays/AlphabeticSearch.java
@@ -14,12 +14,16 @@ public static void main(String[] args) {
14
show(sa);
15
int index = Arrays.binarySearch(sa,
16
sa[10], String.CASE_INSENSITIVE_ORDER);
17
- System.out.println( "Index: "+ index + "\n"+ sa[index]);
+ System.out.println(
18
+ "Index: "+ index + "\n"+ sa[index]);
19
}
20
21
/* Output:
22
[anmkkyh, bhmupju, btpenpc, cjwzmmr, cuxszgv,
-eloztdv, ewcippc, ezdeklu, fcjpthl, fqmlgsh, gmeinne, hyoubzl, jbvlgwc, jlxpqds,
23
-ljlbynx, mvducuj, qgekgly, skddcat, taprwxz, uybypgp, vjsszkn, vniyapk, vqqakbm,
24
-vwodhcf, ydpulcq, ygpoalk, yskvett, zehpfmm, zofmmvm, zrxmclh] Index: 10 gmeinne
+eloztdv, ewcippc, ezdeklu, fcjpthl,
+fqmlgsh, gmeinne, hyoubzl, jbvlgwc, jlxpqds,
25
+ljlbynx, mvducuj, qgekgly, skddcat,
26
+taprwxz, uybypgp, vjsszkn, vniyapk, vqqakbm,
27
+vwodhcf, ydpulcq, ygpoalk, yskvett,
28
+zehpfmm, zofmmvm, zrxmclh] Index: 10 gmeinne
29
*/
collections/ApplesAndOrangesWithoutGenerics.java
@@ -32,6 +32,6 @@ public static void main(String[] args) {
32
___[ Error Output ]___
33
Exception in thread "main" java.lang.ClassCastException:
34
Orange cannot be cast to Apple
35
- at ApplesAndOrangesWithoutGenerics.main(ApplesAndOr
+ at ApplesAndOrangesWithoutGenerics.main(ApplesAndOr
36
angesWithoutGenerics.java:23)
37
collections/ListIteration.java
@@ -27,8 +27,8 @@ public static void main(String[] args) {
30
-Rat, 1, 0; Manx, 2, 1; Cymric, 3, 2; Mutt, 4, 3; Pug, 5, 4;
31
-Cymric, 6, 5; Pug, 7, 6; Manx, 8, 7;
+Rat, 1, 0; Manx, 2, 1; Cymric, 3, 2; Mutt, 4, 3;
+Pug, 5, 4; Cymric, 6, 5; Pug, 7, 6; Manx, 8, 7;
7 6 5 4 3 2 1 0
[Rat, Manx, Cymric, Mutt, Pug, Cymric, Pug, Manx]
[Rat, Manx, Cymric, Cymric, Rat, EgyptianMau, Hamster,
interfaces/interfaceprocessor/StringProcessor.java
@@ -44,6 +44,6 @@ public String process(Object input) {
44
Using Processor Downcase
45
if she weighs the same as a duck, she's made of wood
46
Using Processor Splitter
47
-[If, she, weighs, the, same, as, a, duck,, she's, made, of,
48
-wood]
+[If, she, weighs, the, same, as, a, duck,, she's, made,
+of, wood]
49
lowlevel/DelayQueueDemo.java
@@ -70,10 +70,14 @@ public class DelayQueueDemo {
70
71
72
73
-[128] Task 12 [429] Task 6 [551] Task 13 [555] Task 2 [693] Task 3 [809] Task 15
74
- [961] Task 5 [1258] Task 1 [1258] Task 20 [1520] Task 19 [1861] Task 4 [1998] T
75
-ask 17 [2200] Task 8 [2207] Task 10 [2288] Task 11 [2522] Task 9 [2589] Task 14
76
-[2861] Task 18 [2868] Task 7 [3278] Task 16 (0:4000)
+[128] Task 12 [429] Task 6 [551] Task 13
+ [555] Task 2 [693] Task 3 [809] Task 15
+ [961] Task 5 [1258] Task 1 [1258] Task 20
+ [1520] Task 19 [1861] Task 4 [1998] T
77
+ask 17 [2200] Task 8 [2207] Task 10 [2288]
78
+Task 11 [2522] Task 9 [2589] Task 14
79
+[2861] Task 18 [2868] Task 7 [3278]
80
+Task 16 (0:4000)
81
(1:1258)
82
(2:555)
83
(3:693)
network/ChatterClient.java
@@ -16,7 +16,8 @@ public class ChatterClient implements Runnable {
public ChatterClient(InetAddress hostAddress) {
this.hostAddress = hostAddress;
- System.out.println("ChatterClient #" + id + " starting");
+ "ChatterClient #" + id + " starting");
public void sendAndEcho(String msg) {
try (
@@ -42,6 +43,7 @@ public void sendAndEcho(String msg) {
42
43
@Override
public void run() {
for(int i = 0; i <= 5; i++)
- sendAndEcho("Client #" + id + ", message #" + i);
+ sendAndEcho(
+ "Client #" + id + ", message #" + i);
network/ChatterServer.java
@@ -35,6 +35,8 @@ public void run() {
dp.getAddress(), dp.getPort());
socket.send(echo);
38
- } catch(IOException e) { throw new RuntimeException(e); }
+ } catch(IOException e) {
39
+ throw new RuntimeException(e);
40
+ }
41
objects/ShowProperties.java
@@ -31,7 +31,8 @@ public static void main(String[] args) {
user.dir=C:\Users\Bruce\Documents\GitHub\on-ja...
java.runtime.version=1.8.0_102-b14
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
-java.endorsed.dirs=C:\Program Files (x86)\Java\jdk1.8.0_...
+java.endorsed.dirs=C:\Program Files
+(x86)\Java\jdk1.8.0_...
os.arch=x86
java.io.tmpdir=C:\Users\Bruce\AppData\Local\Temp\
...
operators/URShift.java
@@ -30,7 +30,7 @@ public static void main(String[] args) {
11111111111111111111111111111111
1111111111111111111111
-11111111111111111111111111111111111111111111111111111111111
+111111111111111111111111111111111111111111111111111111111
11111
111111111111111111111111111111111111111111111111111111
reuse/DerivedSpaceShip.java
@@ -3,13 +3,17 @@
3
// We make no guarantees that this code is fit for any purpose.
4
// Visit http://OnJava8.com for more book information.
5
6
-public class DerivedSpaceShip extends SpaceShipControls {
+public class
7
+DerivedSpaceShip extends SpaceShipControls {
8
private String name;
- public DerivedSpaceShip(String name) { this.name = name; }
9
+ public DerivedSpaceShip(String name) {
10
+ this.name = name;
11
12
13
public String toString() { return name; }
public static void main(String[] args) {
- DerivedSpaceShip protector = new DerivedSpaceShip("NSEA Protector");
+ DerivedSpaceShip protector =
+ new DerivedSpaceShip("NSEA Protector");
protector.forward(100);
0 commit comments