Getters and Setters: Why don’t we just make variables public?

In this video we’ll look at getters and setters.

It is not intended to be language specific although I have used C++ code throughout for illustration. Whether you are from a Java, C# or any other Object-Oriented language background, the reasoning behind using getters and setters is the same.

This video is my attempt at describing the answer to the following, very common and very good question:

Why not just make the variables public? Why write getters and setters to access the variable when simply marking the variable as public would do exactly the same thing?

I made a music channel a few whiles ago, Moosik, the link is below: