Is it mandatory to define both the superclass and derived class and the class with "main()" in same file.
i have created three classes named
protection.java,derived.java and samepackage.java.
in different files in package p1.
Superclass "protection.java" is compiling successsfully but when i try to compile the derived class "derived.java" i get an error "cannot find symbol 'protection'" in "class derived extends protection".