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

Answer:

A von Neumann computer uses general purpose memory to store both programs and data.


Picture of an Object

object as memory

In terms of object-oriented programming, a von Neumann computer uses general purpose memory to store both the state and behavior of objects. It is interesting that an idea from the 1940's is still important.

A software object consists of both variables (state information) and methods (recipes for behavior). In the picture, the yellow bricks represent bytes of memory out of which the object is built. This object has some variables, location, color, and size, and has some methods that control its behavior.

In object-oriented programming, the programmer uses a programming language (such as Java) to describe various objects. When a program is running (after being compiled) objects are created out of main storage and start doing things by running methods.

The methods must execute in the correct order. For an application, the first method to run is the method named main(). There should be only one method named main() in an application. In a small application, main() might do by itself all the computation that needs to be done. In a larger application, main() will create objects and use their methods.


QUESTION 6:

Have you seen a main() method before?


go to previous page   go to home page   go to next page