Please enable JavaScript to use CodeHS

AP Computer Science A (Mocha)

Lesson 4.2 Classes vs. Objects

Description

In this lesson, students will dive deeper into the relationship between classes, objects, and instances (generally instances and objects refer to the same thing). Students will get more practice identifying classes and objects, creating objects from classes, and calling methods on objects.


Objective

Students will be able to:

  • Describe the relationship between classes, objects, and instances
    • An object is something that has both state and behavior. An object is an instance of a class
    • A class is a template for creating objects. Objects are instantiated from classes
    • Objects and instances generally refer to the same thing
  • Identify if a given thing is an object or a class
  • Create multiple objects of a given class
  • Call methods on an object to access the object’s state and behavior