上QQ阅读APP看书,第一时间看更新
What is a class?
If you were coming out with a new line of cars, you would want every one of them to be exactly the same, that way you'd know what to expect. To do that you would need a schematic. It's no different in programming. We want each instance of a projectile, vehicle, or weapon to start out exactly the same as any other, and to do that we use classes as our blueprints. Each class contains the variables, functions and other properties that define that object's behavior. Like cars, objects created from a class can be changed after they are created, but the starting point is always the same.