View Single Post
  #2 (permalink)  
Old 04-30-2008, 11:02 PM
hardwired hardwired is online now
Senior Member
 
Join Date: Jul 2007
Posts: 1,141
hardwired is on a distinguished road
what is a constuctor?
Special method with no return type and same name as enclosing class.
See Providing Constructors for Your Classes for more.
Code:
// Type must match: // declaration type == constructor type MysteryRobot09 mary = new MysteryRobot09(forgetsVille, 4, 1, Direction.EAST, 0); MysteryRobot09( City c, int st, int ave, Direction dir, int num) { // This sends these arguments to the superclass Robot // which will keep them. super(c, st, ave, dir, num); }
Reply With Quote