Lesson 15 of 24
Classes and Objects
10 min 30 XP
A class is a blueprint with data members and member functions. private members can't be touched from outside the class (encapsulation); public methods are the way in.
Example: edit me and press Run
Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.Members of a class are private by default; members of a struct are public by default. That's the only difference between them in C++.