Hi I've been trying to get my head around the rules for making classes. One question I have is whether a class must be initialized. Or can a class just hold data without taking an argument.
on 2006-02-19 17:27
on 2006-02-19 18:16
An initialised class (if I guess your meaning correctly) is called an object or an instance. Classes don't have to be initialised to hold data or methods, but from a design perspective class methods and instance methods are used for different things. A class is usually a generic category, and an instance of that class represents a particular object in that category. For instance, "Car" might be a class, and "my VW Jetta" would be an instance of it. Generally, most methods will likely be instance methods, since it's instances that you're usually interested in. Post an example of what you're trying to do - you'll likely get more concrete advice.