Super keyword (calling constructors)

Outputs: Inside A constructor Inside B constructor Inside C constructor Why? When constructor C is called, it actually calls constructor B, which called constructor A. Likewise if we called constructor…

Continue Reading Super keyword (calling constructors)

Super keyword (calling superclass methods)

With the Super keyword, you can: Call superclass methods Call superclass constructors Look at the following example: This outputs: Exception in thread "main" java.lang.StackOverflowError at Square.getInformation(Test.java:30) at Square.getInformation(Test.java:30) at Square.getInformation(Test.java:30)…

Continue Reading Super keyword (calling superclass methods)