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

Class Parcel9

innerclasses/Parcel9.java:6–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4// Visit http://OnJava8.com for more book information.
5
6public class Parcel9 {
7 // Argument must be final or "effectively final"
8 // to use within the anonymous inner class:
9 public Destination destination(final String dest) {
10 return new Destination() {
11 private String label = dest;
12 @Override
13 public String readLabel() { return label; }
14 };
15 }
16 public static void main(String[] args) {
17 Parcel9 p = new Parcel9();
18 Destination d = p.destination("Tasmania");
19 }
20}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected