If you define the subclass class itself:
public class Test {
public static void main(String[] args) {
}
class TestChild extends Test {
}
}
Then yes, it is possible. But note that these are two completely separate classes, except that one is internal to the other.
source
share