Consider this code:
class Test {
Test() {
System.out.println(\"In constructor of Superclass\");
}
int adds(int n1, int n2) {
ret
here your extending Test to your test1 class meaning u can access all the methods and variable of test in your test1. keep in note that u can access a class methods or variable only if memory is allocated to it and for that it need some constructor either a default or parameterized ,so here wen the compiler finds that it is extending a class it will try to find the super class constructor so that u can access all its methods.