Day 10 | What Is a Class in C#?

July 16, 2022

I’m trying to figure out what classes are. I found this video to help called “C# Classes in Unity! - Beginner Scripting Tutorial,” but to be honest, this video is pretty confusing even though the beginning was helpful: https://youtu.be/odKtPBsyFnw

Brackeys made a great video about classes called “How to Program in C# - Classes (E07)”: https://youtu.be/WKjfCHxeEz4

From my understanding, I think that a Class is a container that can be called on repeatedly in a program, but you can fill the container with different specifications each time an instance of the Class is created. It’s like creating a class called “Cat.” When I first make up a Class, that is when I decide exactly what kinds of things I want it to be filled with—the age of the cat, the name of it, the color. Then, later, when I create an actual instance of that Class, I can then decide to fill that proverbial container with specifics for those things. Each instance of the Class that I create can be filled with different specifics to differentiate it from the one before—so instead of an orange cat, I can specify a brown cat. Using Classes is a good way to make duplicatable things.

Previous
Previous

Day 11 | Understanding “Public” vs “Private”

Next
Next

Day 9 | It’s Starting to Click + a Must-Watch Series