20 lines
516 B
Java
20 lines
516 B
Java
|
//: innerclasses/Parcel8.java
|
|||
|
// <20>2015 MindView LLC: see Copyright.txt
|
|||
|
// Calling the base-class constructor.
|
|||
|
|
|||
|
public class Parcel8 {
|
|||
|
public Wrapping wrapping(int x) {
|
|||
|
// Base constructor call:
|
|||
|
return new Wrapping(x) { // Pass constructor argument.
|
|||
|
@Override
|
|||
|
public int value() {
|
|||
|
return super.value() * 47;
|
|||
|
}
|
|||
|
}; // Semicolon required
|
|||
|
}
|
|||
|
public static void main(String[] args) {
|
|||
|
Parcel8 p = new Parcel8();
|
|||
|
Wrapping w = p.wrapping(10);
|
|||
|
}
|
|||
|
} /* Output: (None) *///:~
|