MCPcopy Create free account
hub / github.com/Berkeley-CS61B/skeleton-sp23 / get

Method get

lab02/src/common/IntList.java:13–18  ·  view source on GitHub ↗

Returns the ith item of this IntList.

(int i)

Source from the content-addressed store, hash-verified

11
12 /** Returns the ith item of this IntList. */
13 public int get(int i) {
14 if (i == 0) {
15 return first;
16 }
17 return rest.get(i - 1);
18 }
19
20 /**
21 * Method to create an IntList from an argument list.

Callers

nothing calls this directly

Calls 1

getMethod · 0.65

Tested by

no test coverage detected