latest {main: fixes
This commit is contained in:
parent
df864d009d
commit
9659aa6adf
@ -3,6 +3,8 @@
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Recover a serialized file
|
||||
// {main: serialization.xfiles.ThawAlien}
|
||||
// {RunFirst: FreezeAlien}
|
||||
package serialization.xfiles;
|
||||
import java.io.*;
|
||||
|
||||
@ -10,7 +12,7 @@ public class ThawAlien {
|
||||
public static void
|
||||
main(String[] args) throws Exception {
|
||||
ObjectInputStream in = new ObjectInputStream(
|
||||
new FileInputStream(new File("..", "X.file")));
|
||||
new FileInputStream(new File("X.file")));
|
||||
Object mystery = in.readObject();
|
||||
System.out.println(mystery.getClass());
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {main: staticchecking.dr.DogsAndRobots}
|
||||
package staticchecking.dr;
|
||||
|
||||
interface Speaks { void talk(); }
|
||||
|
@ -2,6 +2,7 @@
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {main: staticchecking.drc.DogAndRobotCollections}
|
||||
package staticchecking.drc;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {main: staticchecking.latent.Latent}
|
||||
package staticchecking.latent;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Speaking pets in Java
|
||||
// {main: staticchecking.petspeak.PetSpeak}
|
||||
package staticchecking.petspeak;
|
||||
|
||||
interface Pet {
|
||||
|
@ -3,6 +3,7 @@
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// The difference between instanceof and class
|
||||
// {main: typeinfo.FamilyVsExactType}
|
||||
package typeinfo;
|
||||
|
||||
class Base {}
|
||||
|
@ -3,6 +3,7 @@
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Using class literals
|
||||
// {main: typeinfo.pets.LiteralPetCreator}
|
||||
package typeinfo.pets;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Testing class Class
|
||||
// {main: typeinfo.toys.GenericToyTest}
|
||||
package typeinfo.toys;
|
||||
|
||||
public class GenericToyTest {
|
||||
|
@ -3,6 +3,7 @@
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Testing class Class
|
||||
// {main: typeinfo.toys.ToyTest}
|
||||
package typeinfo.toys;
|
||||
|
||||
interface HasBatteries {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user