Computer Science
FIRST
Java

hear and forget

see and remember

do and understand
Confucius

We are going to do some Java applet coding to try understand some concepts. Concepts are layered like onions. Understanding the different levels of a concept sometimes requires a lot of time and work.


the event-model - The computer waits for something (an event) to happen. If something happens then the computer handles the event then returns to waiting.

Download the following files to see an example of event handling.

Notice the use of TextArea and Button in this example.


the boolean arrays - a list of boolean values can be useful in storing information.

mod or % - the mod operator is like a remainder operator

Download the following example of the use of % and boolean arrays.

What are the merits of each of the choices made for display?

the graphics - canvas a drawing component--fillRect(x,y,width,height)

Download the following files to see an example of graphics.


2D arrays a real case for 2-dimensional arrays

Download the following files to see an example of a boolean Pascal's Triangle.


Wrap around using mod

Download the following files to see an example of Conway's Game of Life


mouse clicks - to input the initial patterns and modify the patterns

Download the following files to see an example of Conway's Game of Life


More resources