found out in my own code the statement which looks like constructor for object instance, but it is actually not. I completely forgot where did I took the sample of such statement as for "Hi" print below, but it works like a constructor, while it is probably not. this code
public class TestSet {
String hi="Hi";
public TestSet(){
System.out.println("Bye");
}
{
System.out.println(hi);
}
public static void main(String s[]){
new TestSet();
}
}
actually prints out "Hi" and "Bye" aaaand, if TestSet would have a superclass, then putting "super" in "Hi" piece of code will not work. so what is it? I was trying to googling, but it is hard to formulate the query. thanks!