+ 5
For me it has helped to simply think about classes as blueprints that you use to create objects in the world. Just like in the "real" world, we have blueprints that map out what we're building, provides its defaults, provides the methods we'll use on it and what stuff the object itself will be capable of doing once in the world. Then we use that blueprint (class) to create (instantiate) objects from it that we'll use in the world (program). We can create as many of the objects as we want, and each of the individual objects will not affect each other or the original blueprint, so you can manipulate each of the individual objects as needed without having to worry about it impacting the other ones. (worth noting there are means of changing the blueprint/etc..., but for analogy purposes, just bare with me. lol) When I think about it like that, it becomes a lot easier for me to understand the various aspects of it, why, and how it operates. As simple as it sounds, think of it as actual objects.
8th Nov 2017, 4:29 PM
AgentSmith