Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Originally posted by anilkuj:
interface a{
void method();
public interface b{
void method2();
}
}
public class MyClass implements a{
public void method()
{System.out.println("ha");}
public static void main(String[] arg){
MyClass mc=new MyClass();
mc.method();
}
}
what is happening how am i able to instantiate an object of class
MyClass eventhough i haven't given the body of the method in the inner interface , i know that inner interfaces are implicitly static but still that doesn't explain my question
help me soon...............
Njoy
Njoy
A static nested class [interface] acts just like any top-level class except that its name and accessiblity are defined by its enclosing class.
Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport