xxxxxxxxxx
class outerClass {
// defining anonymous class
object1 = new Type(parameterList) {
// body of the anonymous class
};
}
xxxxxxxxxx
//for Java 10
boolean result = true;
var objResult = new Object() {
boolean success = result;
};
System.out.println(objResult.success);