I’m learning java and accidentally I came across following code where default constructor is executed after the method. public class ChkCons { int var = getVal(); ChkCons() { System.out.println("I'm Default Constructor."); } public int getVal() { System.out.println("I'm in Method."); return 10; } public static void main(String[] args) { ChkCons c = new ChkCons(); } } […]
The post Java – Method executed prior to Default Constructor appeared first on BlogoSfera.