Writing Classes

What a Class Is. A class is a blueprint that describes a kind of object. It bundles together two things: state (the data an object remembers) and behavior (the actions an object can perform). Every object you create from the class is an instance of it, and eac

8 lessons, each with runnable code in the browser.

  1. Anatomy of a Class
  2. Instance Variables and State
  3. Constructors
  4. Accessor and Mutator Methods
  5. The this Keyword
  6. Encapsulation and private
  7. Static vs Instance Members
  8. toString and Method Decomposition

Compilearn home