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

Class Parcel7

innerclasses/Parcel7.java:7–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5// Returning an instance of an anonymous inner class
6
7public class Parcel7 {
8 public Contents contents() {
9 return new Contents() { // Insert class definition
10 private int i = 11;
11 @Override public int value() { return i; }
12 }; // Semicolon required
13 }
14 public static void main(String[] args) {
15 Parcel7 p = new Parcel7();
16 Contents c = p.contents();
17 }
18}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected