Skip to content

Commit 9659aa6

Browse files
author
Bruce Eckel
committed
latest {main: fixes
1 parent df864d0 commit 9659aa6

9 files changed

Lines changed: 11 additions & 1 deletion

File tree

serialization/xfiles/ThawAlien.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
// Recover a serialized file
6+
// {main: serialization.xfiles.ThawAlien}
7+
// {RunFirst: FreezeAlien}
68
package serialization.xfiles;
79
import java.io.*;
810

911
public class ThawAlien {
1012
public static void
1113
main(String[] args) throws Exception {
1214
ObjectInputStream in = new ObjectInputStream(
13-
new FileInputStream(new File("..", "X.file")));
15+
new FileInputStream(new File("X.file")));
1416
Object mystery = in.readObject();
1517
System.out.println(mystery.getClass());
1618
}

staticchecking/dr/DogsAndRobots.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5+
// {main: staticchecking.dr.DogsAndRobots}
56
package staticchecking.dr;
67

78
interface Speaks { void talk(); }

staticchecking/drc/DogAndRobotCollections.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5+
// {main: staticchecking.drc.DogAndRobotCollections}
56
package staticchecking.drc;
67
import java.util.*;
78

staticchecking/latent/Latent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5+
// {main: staticchecking.latent.Latent}
56
package staticchecking.latent;
67
import java.lang.reflect.*;
78

staticchecking/petspeak/PetSpeak.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
// Speaking pets in Java
6+
// {main: staticchecking.petspeak.PetSpeak}
67
package staticchecking.petspeak;
78

89
interface Pet {

typeinfo/FamilyVsExactType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
// The difference between instanceof and class
6+
// {main: typeinfo.FamilyVsExactType}
67
package typeinfo;
78

89
class Base {}

typeinfo/pets/LiteralPetCreator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
// Using class literals
6+
// {main: typeinfo.pets.LiteralPetCreator}
67
package typeinfo.pets;
78
import java.util.*;
89

typeinfo/toys/GenericToyTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
// Testing class Class
6+
// {main: typeinfo.toys.GenericToyTest}
67
package typeinfo.toys;
78

89
public class GenericToyTest {

typeinfo/toys/ToyTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
// Testing class Class
6+
// {main: typeinfo.toys.ToyTest}
67
package typeinfo.toys;
78

89
interface HasBatteries {}

0 commit comments

Comments
 (0)