final keyword in method local inner class:
Is I declare my method-local inner class as final,I cannot instantiate it then how can I access method of it ?
public class HHH
{
public static int sampleMethod()
{
final class AC {
int m(){
return 0;}
}
class CC {
int m() {
return 42;
}
}
AC c = new AC();
// cannot instantiate final class then how can I instantiate in method local //class.Is it valid to do ?
return c.m();
}
public static void main(
String[] args) {
System.out.println(sampleMethod());
}
}
[ February 01, 2007: Message edited by: Kasak Tahilramani ]