This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
in the following program when i call Users's class argumented constructor new User("JLC","JLC"); then why User class default constructor has been called ? as i am calling this(); keyword . constructor call inside a constructor should be the first statement so why it is invoking super() and this() both, i mean when i run this program it gives the output like
When new User("JLC","JLC"); statement executed following things happen
1 this() will call no argument constructor User()
2 no argument constructor User() will call super() which in turn call Person()
3 now Person() will call super() that is constructor of Object class and then person body will complete the execution then User() body will complete the execution then User(String , String) body will complete the execution.
I hope this will help you to understand. In case of any mistake please let me know.