abstract class SomeClass { public abstract void m1(); }
public class TestClass
{
public static class StaticInnetClass { } //option 1
public SomeClass getSomeClass()
{
return new SomeClass()
{
public void m1() { }
};
}
}
Is this the way meant for extending from SomeClass? Without using "extends" anywhere?
Anonymous inner classes can also be, instance members, and declared outside the method in class.
The question should denote that, which anonymous inner class we are referring here.
Not sure which option are you referring to here and what is your issue with that option. Can you please provide more information about what you are trying to convey?
If you like our products and services, please help us by posting your review here.
public class Hi {
private static Function<String, Integer> F = new Function<String, Integer>() {
public Integer apply(String s) {
return Integer.valueOf(s);
}
};
}