| 4 | // Visit http://OnJava8.com for more book information. |
| 5 | |
| 6 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected