[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[Honesty]
[Links]
[Syllabus]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
Misc:
[SamR]
[Java 1.4.2 API]
[Ant Documentation]
Back to Java Packages. On to Polymorphism (3).
Held: Friday, 3 September 2004
Summary: Today we continue our investigation of the candy problem, which builds upon our understanding of polymorphism. Along the way, we'll learn some cool Java tricks and at least one important design pattern.
Related Pages:
Overview:
GumballMachine
).
getClass
.
getConstructor
.
Abstract Factoryproblem and build a
CandyMachineFactory
.
So, what did you do with the factory problem?
new Constructor() { NewAndOverridenMethods }
PrintWriter pen = new PrintWriter(System.out, true) { public void println(String whatever) { super.println("*** " + whatever + " ***"); } };
CandyMachineTester cmt = new CandyMachineTester( new BiggerCandyMachine( new CandyMachineFactory() { public CandyMachine build() { return new DoubledCandyMachine( new ChickletMachine()); } }));
Back to Java Packages. On to Polymorphism (3).
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[Honesty]
[Links]
[Syllabus]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Readings]
[Reference]
Misc:
[SamR]
[Java 1.4.2 API]
[Ant Documentation]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Mon Dec 6 08:49:58 2004.
The source to the document was last modified on Fri Sep 3 09:00:00 2004.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS223/2004F/Outlines/outline.04.html
.
You may wish to
validate this document's HTML
;
;
Check with Bobby