Developer's Daily | Java Education - Test Projects |
front page | java | perl | unix | DevDirectory |
/** * Main class (driver) for the DogFactory. */ public class Main { public Main() { // create a small dog Dog dog = DogFactory.getDog("small"); dog.speak(); // create a big dog dog = DogFactory.getDog("big"); dog.speak(); // create a working dog dog = DogFactory.getDog("working"); dog.speak(); System.out.println( "abs of -1 = " + Math.abs(-1) ); } public static void main(String[] args) { new Main(); } } |
|
Copyright © 1998-2003 DevDaily
Interactive, Inc. All Rights Reserved. |