interface SampleInterface{
void method();
}
public class Outer {
public static void main(String[] args) {
Outer o = new Outer();
o.method().method();
}
SampleInterface method() {
String name = "sato";
class SampleLocalClass implements SampleInterface {
@Override
public void method() {
System.out.println("name:" + name);
}
}
return new SampleLocalClass();
}
}
name:sato