next up previous contents
Next: Basic program structure Up: 1 Programming Basics Previous: 1 Programming Basics   Contents

Computer programs and java

A computer program is fundamentally just a set of instructions for the computer to follow. Running a program means the computer executes the instructions that comprise the program.

Programming in Java involves the programmer writing a set of instructions in the Java language. The file this Java code is saved in, is known as a source file and has the name something.java. The source file must then be compiled1. The compiler reads and understands the program written in the source file, then translates it and writes it out into a second file (called something.class). This file contains the same program instructions written in a different form, to better suit the computer rather than you the programmer. Whenever the program is run the contents of this second file go through an interpreter which turns the contents into instructions that the computer's processor2 can understand and carry out.


next up previous contents
Next: Basic program structure Up: 1 Programming Basics Previous: 1 Programming Basics   Contents
RHUL Dept. of Physics