Originally posted by Ding:
Constructors can't have return types, and super() makes little sense outside of a constructor.
Or at least I've never seen super() outside of a constructor.
You'll see super() used occasionally outside constructors. Usually happens when you override a method in a class you're extending but still want the original parent method to be called. For example:
code:<HR>Code:public class MoreStuff extends Stuff { // constructors and other misc.<P> public void doStuff() { System.out.println("Doing more stuff!");<P> // have to use super() since simply calling doStuff() again will // result in recursion w/o a stop condition<P> // This would probably print "Do stuff!" or similar super().doStuff(); } }