Classe anonyme java
class outerClass {
// defining anonymous class
object1 = new Type(parameterList) {
// body of the anonymous class
};
}
SAMER SAEID
class outerClass {
// defining anonymous class
object1 = new Type(parameterList) {
// body of the anonymous class
};
}
public class FunctionInterfaceTest {
public static void main(String[] args) {
// anonymous class
new Thread(new Runnable() {
@Override
public void run() {
System.out.println("I just implemented the Runnable Functional Interface.");
}
}).start();
}
}