posted 21 years ago
In a constructor, you can call the superclass constructor using super() syntax.If you don't insert the call to super() as the first line in the constructor, the compiler will insert an implicit no-argument call to the superclass constructor. It is considered good practice to always put in the super() call regardless.
For method calls, you use super.methodName() syntax.If you would omit the "super." prefix, the foobar() method would be recursively calling itself -- probably leading into an endless loop and an eventual death in a stack overflow.
- Peter
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd