A von Neumann computer uses general purpose memory to store both programs and data.
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 (recipies 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 programer uses a programming language (such as Java) to describe various objects. When the program is run (after being compiled) the objects are created (out of main storage) and they start "doing things" by running their 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.
Have you seen a main()
method before?