Classes & Objects

Learn object-oriented programming. Create classes with member variables, methods, and constructors.

54 lessons
224 min

Lessons

1. Intro

The Goal

4m

2. What is a Class?

User-defined types

4m

3. What is an Object?

Concrete entities

5m

4. Defining a Class

Basic structure

5m

5. Creating Objects

Declaring instances

5m

6. Quiz: Default access

Default access

3m1 problems

7. Access Specifiers

Controlling visibility

5m

8. Why Use Private?

Hiding internals

4m

9. Quiz: Conditional execution

Conditional execution

3m1 problems

10. Member Variables

Object state

5m

11. Member Functions

Object behavior

5m

12. Quiz: Member access

Member access

3m1 problems

13. Accessing Members with Dot Operator

Using objects

4m

14. Quiz: Classes and Objects Basics

Knowledge check

3m1 problems

15. The this Pointer

Self-reference

4m

16. Getters and Setters

Controlled access

5m

17. What is a Constructor?

Initialization function

4m

18. Default Constructor

No parameters

5m

19. Quiz: Custom data types

Custom data types

3m1 problems

20. Parameterized Constructor

Custom initialization

5m

21. Constructor Overloading

Multiple constructors

4m

22. Member Initializer Lists

Efficient initialization

4m

23. Quiz: Constructors

Knowledge check

3m1 problems

24. What is a Destructor?

Cleanup function

4m

25. Destructor Syntax and Usage

Implementation details

5m

26. RAII Concept

Acquisition is initialization

4m

27. When Destructors Run

Automatic invocation

4m

28. Quiz: Custom data types

Custom data types

3m1 problems

29. Quiz: Destructors and RAII

Knowledge check

3m1 problems

30. Copy Constructor Basics

Copying objects

4m

31. Default vs Custom Copy Constructor

Shallow vs deep copy

4m

32. Class vs Struct Differences

Default access

5m

33. Quiz: Copy Constructor

Knowledge check

3m1 problems

34. Static Members

Class-level data

5m

35. Const Member Functions

Read-only methods

4m

36. Quiz: Member access

Member access

3m1 problems

37. Quiz: Static and Const Members

Knowledge check

3m1 problems

38. Practice: Bank Account Class

Build complete class

5m

39. Practice: Dynamic String Class

RAII practice

4m

40. Quiz: Default access

Default access

3m1 problems

41. Quiz: Full Review

Knowledge check

3m1 problems

42. Problem - Young Physicist

Force equilibrium check

4m1 problems

43. Young Physicist - The Pattern

Encapsulating vector data

5m

44. Young Physicist - Algorithm

Breaking it down

4m

45. Quiz: Default access

Default access

3m1 problems

46. Young Physicist - Implementation

Complete solution

7m1 problems

47. Lessons from Young Physicist

summary

4m

48. Problem - Games

Color matching check

4m1 problems

49. Games - The Pattern

Pairing and checking

5m

50. Games - Algorithm

Breaking it down

5m

51. Quiz: Default access

Default access

3m1 problems

52. Games - Implementation

Complete solution

7m1 problems

53. Lessons from Games

summary

4m

54. Section Recap

What we learned

5m

Ready to start learning?

Access all 54 lessons with interactive content and progress tracking.