I am a newbie to Java , please have a look at the below Code
//Parent Class
public class Abc {
Abc(){System.out.println("hiii");
}
}
//Child Class
public class CDE extends Abc{
@Test
public void Xyz(){
System.out.println("hi");
}
}
Output is coming as
hiii
hi
PASSED: Xyz
Please help , i am not sure why the constructor of parent class is getting called when i am not even using the new Keyword to create object.I have created two different classes in Eclipse.Same is not happening if i am creating main method in child class ie not using TestNG @Test annotation.