MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples

github.com/BruceEckel/OnJava8-Examples @3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 3.0 ↗ · + Follow
4,931 symbols 10,002 edges 1,041 files 8 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Example Source Code for the Book "On Java 8" by Bruce Eckel

Download the latest release from here.

To compile and run these programs, you only need JDK 8 installed. Invoking gradlew will automatically download and install Gradle. Gradle will also install all additional libraries necessary to compile and run the Java examples in the book.

To compile and run everything, the command is:

gradlew run

If you are on a Unix/Linux based system, you must select the local directory for all commands, for example:

./gradlew run

To only compile everything, the command is:

gradlew compileJava

To compile only a single chapter (including dependencies), use for example:

gradlew :strings:compileJava

To run only a single chapter, say:

gradlew :strings:run

Gradle can also be used to run a single program. Here, we run the ReplacingStringTokenizer.java program in the strings chapter subdirectory:

gradlew :strings:ReplacingStringTokenizer

However, if the file name is unique throughout the book (the majority are), you can just give the program name, like this:

gradlew ReplacingStringTokenizer

Note that all commands are run from the base directory where the example code is installed, and where you find the gradlew script.

You can learn about other options by just typing gradlew with no arguments.

Extension points exported contracts — how you extend this code

A (Interface)
(no doc) [102 implementers]
reflection/interfacea/A.java
Contents (Interface)
(no doc) [12 implementers]
innerclasses/Contents.java
Destination (Interface)
(no doc) [8 implementers]
innerclasses/Destination.java
Speaker (Interface)
(no doc) [14 implementers]
staticchecking/petspeak.go
HasID (Interface)
(no doc) [10 implementers]
concurrent/HasID.java
Resource (Interface)
(no doc) [14 implementers]
patterns/Resource.java
FactoryMethod (Interface)
(no doc) [15 implementers]
patterns/shapes/FactoryMethod.java
TypedBinMember (Interface)
(no doc) [8 implementers]
patterns/doubledispatch/TypedBinMember.java

Core symbols most depended-on inside this repo

print
called by 166
housekeeping/Leaf.java
show
called by 166
onjava/ArrayShow.java
get
called by 139
generics/Mixins.java
add
called by 82
enums/CarWash.java
format
called by 80
strings/Hex.java
setAll
called by 74
validating/jmh/JMH2.java
stream
called by 67
streams/Signal.java
array
called by 58
onjava/Rand.java

Shape

Method 3,081
Class 1,642
Interface 131
Enum 52
Function 18
Struct 7

Languages

Java98%
C++1%
Python1%
Go1%

Modules by API surface

onjava/Rand.java52 symbols
onjava/Count.java52 symbols
interfaces/nesting/NestingInterfaces.java41 symbols
innerclasses/GreenhouseControls.java37 symbols
generics/BasicBounds.java29 symbols
polymorphism/music3/Music3.java26 symbols
interfaces/music4/Music4.java26 symbols
generics/EpicBattle.java26 symbols
serialization/AStoreCADState.java23 symbols
onjava/Countries.java23 symbols
reflection/RegisteredFactories.java21 symbols
references/CopyConstructor.java21 symbols

For agents

$ claude mcp add OnJava8-Examples \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact