Connexions

Sections
You are here: Home » Content » Inner Classes

About: Inner Classes

Module by: Stephen Wong, Dung Nguyen

View content

Metadata

Name: Inner Classes
ID: m17220
Language: English (en)
Summary: In Java, besides having fields and methods, a class can also have other classes as members. Just like fields and methods, a class member of can be static or non-static. A non-static class member is called an inner class. Inner class is a programming construct based on the powerful concept of closure prevalent in the functional programming paradigm. It allows on-the-fly creation of objects, which can communicate transparently with the enclosing object inside of which they come into existence. We illustrate the rationale and use of inner classes via a progression from top level helper classes to named static nested classes, to non-static named classes, and to anonymous inner classes with dynamic on-the-fly instantiation.
Subject: Science and Technology
Keywords: anonymous, closure, helpers, inner, nested, object-oriented, on-the-fly, OO, OOP
Document Type: -//CNX//DTD CNXML 0.5 plus MathML//EN
License: Creative Commons Attribution License (CC-BY 2.0)

Authors: Stephen Wong (swong@rice.edu), Dung Nguyen (dxnguyen@rice.edu)
Copyright Holders: Stephen Wong (swong@rice.edu), Dung Nguyen (dxnguyen@rice.edu)
Maintainers: Alex Tribble (prat@rice.edu), Stephen Wong (swong@rice.edu), Dung Nguyen (dxnguyen@rice.edu)

Version: 1.1 (history)
Created: Jun 19, 2008 2:42 pm GMT-5
Revised: Jul 14, 2008 11:30 am GMT-5

Version History

Version: 1.1 Jul 14, 2008 11:30 am GMT-5 by Dung Nguyen
Changes:
new module

How to Reuse and Attribute This Content

If you derive a copy of this content using a Connexions account and publish your version, proper attribution of the original work will be automatically done for you.

If you reuse this work elsewhere, in order to comply with the attribution requirements of the license (CC-BY 2.0), you must include

  • the authors' names: Stephen Wong, Dung Nguyen
  • the title of the work: Inner Classes
  • the Connexions URL where the work can be found: http://cnx.org/content/m17220/1.1/

See the citation section below for examples you can copy.

How to Cite and Attribute This Content

The following citation styles comply with the attribution requirements for the license (CC-BY 2.0) of this work:

American Chemical Society (ACS) Style Guide:

Wong, S.; Nguyen, D. Inner Classes, Connexions Web site. http://cnx.org/content/m17220/1.1/, Jul 14, 2008.

American Medical Assocation (AMA) Manual of Style:

Wong S, Nguyen D. Inner Classes [Connexions Web site]. July 14, 2008. Available at: http://cnx.org/content/m17220/1.1/.

American Psychological Assocation (APA) Publication Manual:

Wong, S., & Nguyen, D. (2008, July 14). Inner Classes. Retrieved from the Connexions Web site: http://cnx.org/content/m17220/1.1/

Chicago Manual of Style (Bibliography):

Wong, Stephen, and Dung Nguyen. "Inner Classes." Connexions. July 14, 2008. http://cnx.org/content/m17220/1.1/.

Chicago Manual of Style (Note):

Stephen Wong and Dung Nguyen, "Inner Classes," Connexions, July 14, 2008, http://cnx.org/content/m17220/1.1/.

Chicago Manual of Style (Reference, in Author-Date style):

Wong, S., & Nguyen, D. 2008. Inner Classes. Connexions, July 14, 2008. http://cnx.org/content/m17220/1.1/.

Modern Languages Association (MLA) Style Manual:

Wong, Stephen, and Dung Nguyen. Inner Classes. Connexions. 14 July 2008 <http://cnx.org/content/m17220/1.1/>.