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

Answer:

Objects and primitive data.


Modularity and Objects

A vital idea in programming (and perhaps in all of science and math) is how large things are built of smaller things, and how those large things are used to build even larger things.

The classic example is Lego bricks, where individual bricks are used to build larger assemblies which in turn are used to build even larger assemblies, which are used to build even larger constructions.

In geometry, Euclid's axioms are the basic bricks, which are used to build basic theorems, which in turn are used to build more theorems, which are used to build even more advanced theorems. Over the years, a very large structure has been built out of the fundamental axioms. (And the building continues to this day.)

In programming, this idea is called modularity. A module encapsulates some well-defined functions and data and is used as a brick to build even larger modules. We have already seen this with expressions built out of operands and operators, statements built out of expressions, statements put into larger groups to make programs.

Industrial-strength programs can be very large. A modern operating system can be 10s of millions of lines of code. This would be impossible to create without the idea of dividing it into thousands of individual modules.

In object oriented programming, the idea of modularity is implemented with objects. An object contains both data and methods and can be used like a brick to build larger objects.

You will see much more on modularity and objects in the following chapters.


QUESTION 2:

(Review: ) What are the two divisions of data in Java?


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