The Artima Developer Community
Sponsored Link

Why not this for the constuctors of CoffeeCup?

Advertisement

Advertisement

This page contains an archived post to the Design Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Why not this for the constuctors of CoffeeCup?

Posted by Bryan Boone on 06 Apr 1998, 10:06 AM

public class CoffeeCup {
public CoffeeCup() {
innerCoffee = 0;
setSize(SHORT);
}
public CoffeeCup(int size) {
this();
setSize(size);
}
public CoffeeCup(int size, int startingAmount) {
this(size);
add(startingAmount);
}
... //your other functions
}



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us