Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/BruceEckel/OnJava8-Examples
/ fill
Method
fill
generics/PrimitiveGenericTest.java:11–11 ·
view source on GitHub ↗
(T[] a, Supplier<T> gen)
Source
from the content-addressed store, hash-verified
9
// Fill an array using a generator:
10
interface
FillArray {
11
static
<T> T[] fill(T[] a, Supplier<T> gen) {
12
Arrays.setAll(a, n -> gen.get());
13
return
a;
14
}
Callers
6
main
Method · 0.95
main
Method · 0.65
main
Method · 0.65
CircularSet
Method · 0.65
main
Method · 0.65
main
Method · 0.65
Implementers
3
PrintingCollections
collections/PrintingCollections.java
TypesForSets
collectiontopics/TypesForSets.java
Suppliers
onjava/Suppliers.java
Calls
no outgoing calls
Tested by
1
main
Method · 0.76