Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/BruceEckel/OnJava8-Examples
/ types
Method
types
reflection/pets/Creator.java:15–15 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
13
private
Random rand =
new
Random(47);
14
// The different types of Pet to create:
15
public
abstract List<Class<? extends Pet>> types();
16
@Override
public
Pet get() {
// Create one random Pet
17
int
n = rand.nextInt(types().size());
18
try {
Callers
1
get
Method · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected