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.
You are passing the value a to the 2nd constructor and giving it the title "a". Then you are giving "a" the value of b in the 1st constructor.
Does that help?
Joined: Feb 01, 2008
it says "implicit super constructor A() is undefined.Must explicitly invoke another constructor"
can you tell me whats the mistake in normal words?
Joined: Aug 05, 2005
If you don't include a call to any of the parent class constructors (using super) in your constructors, then the compiler implicitly includes a call to the parent classes no arg constructor. If the parent class doesn't have a no arg constructor then you get this error.
The solution is to either add a no arg constructor to your A class or explicitly include a call to one of the A class constructors in your B class constructors. e.g.