Algorithms and OOD (CSC 207 2014F) : Outlines

Outline 21: Anonymous Inner Classes


Held: Friday, 3 October 2014

Back to Outline 20 - Anonymous Functions. On to Outline 22 - Analyzing Algorithms.

Summary

We explore anonymous inner classes, a powerful Java programming technique.

Related Pages

Extra Credit Opportunities

Academic

Peer Support

Miscellaneous

Overview

Administrivia

Upcoming Work

Extra Credit Opportunities

Academic

Peer Support

Miscellaneous

Anonymous Inner Classes

Syntax

With interfaces

new NAME-OF-INTERFACE() 
  {
    BODY-OF-CLASS;
  }

With classes

new NAME-OF-CLASS()
  {
    BODY-OF-SUBCLASS;
  }

Subtleties

Anonymous Inner Classes vs. Anonymous Functions

Lab