Edit - Program source is stored in a file. Written,
modified, updated using an editor.
Translate - Program source is converted from its
textual form into a form that can be executed by a machine (i.e., machine code or machine language)
Compile - translate from high-level programming language
to machine code all in one shot
Interpret - translate from high-level programming language
to machine code a statement at a time, throwing away machine
code for the statement after it has been executed
Execute - Machine code is executed on the machine
Edit/Translate/Execute Process in Java
Edit -
Each file contains a single class
Use comment header!
File name is X.java, where the
name X is the name of the class.
Translate - uses both compile and interpreter
javac X.java - Compile X.java into X.class
X.class is not machine code - it is called java byte code
X.class is executed by a Java interpreter
Many languages are compiled (since it is efficient)! Why this approach?
Portability, sharing
Embed byte code in WWW browsers
Execute -
java X
Time
Different times in programming
program writing time - when program is being edited
compile time - when program is being translated
execute time - when program is being executed
Different times in Java programming
program writing time - comments written when writing code,
ignored by compiler, never executed
detect errors at compile time - spelling errors, typos
system.out.println ("foo");
Systemoutprintln ("foo");
system.out.println ("foo);
execute time - statements in wrong order, mistakes in strings
System.out.println ("Print this second"); System.outprintln ("Print this first");
System.out.println ("Komputer Science is fun!");
Terminology
YOU SHOULD KNOW AND UNDERSTAND THE TERMINOLOGY DESCRIBED ON PAGES 20-21.
Last modified: 1/12/99