go to previous page   go to home page   go to next page hear noise

Answer:

Yes. In order for a plan to be followed, it has to somehow exist.


Static

Classes are mostly used to create objects, just as a cookie cutter is mostly used to create cookies. But a class has an existence, just as a cookie cutter has an existence. A class and its objects are different types of things, just as a cookie cutter and its cookies are different types of things.

A cookie cutter has characteristics that are not shared with cookies. For example, a cookie cutter is made of steel and has sharp edges. It is not good to eat.

After a cookie cutter has been used for a while, there will be many cookies (soft, rounded, doughy things) but only one thing made of steel with sharp edges.

In Java, a characteristic of a class definition that is not shared by its objects is called static. There is only one class definition for a given class, so when a program is running, if something is static then there is only one of it.

You can think of the word static as meaning "no matter how many objects have been made, there is only one of these."


QUESTION 12:

Recall the three properties of objects: identity, state, and behavior. Do you expect that a class definition has its own state and behavior?