Learn

Hooray! You’ve learned the basics of classes and objects in C++:

  • Classes are user-defined types.
  • Objects are instances of classes.
  • Class members are the data attributes and functions inside of a class.
  • Creating a new object from a class is called instantiation.
  • Class members can be designated as either private or public — they are private by default.
  • You can create a constructor to instantiate objects in a particular way.
  • A destructor allows you to execute any cleanup necessary before an object gets destroyed.

Instructions

We’ve added a few files so you can create some of your own classes and objects!

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?