Review Of Creating and Using Classes and Objects

From Huben's Wiki
Jump to: navigation, search

Based on learning from projects:


  • Constructors
    • initialize fields
    • overloading
    • can call each other with this()
  • Creating and using objects
    • Variables have names, can be basic types or object types: they are not objects themselves.
    • Object type variables contain addresses of the objects
    • Objects (or instances) have no names, but they have a type (or class)
  • Arrays of objects.
    • Creating the variable.
    • Creating the array.
    • Setting the elements of the array to objects.
    • Accessing the elements of the array of objects.
  • Using methods and fields of objects.
    • The dot operator.
    • Scope of public and private fields and methods.
    • Accessors and modifiers.
    • Data hiding.
    • toString() method
  • Constants
    • Are static final fields in a class, usually public.
Personal tools