Java developed as a modern world option for computer programming. Don’t think about why, but machines do not know how to communicate in English or any other human language. Machines (or Computer Hardware) know how to work with binaries which are zeros and ones (0 and 1) and probably we don’t. Java knows how to convert English into these 0s and 1s and work with hardware.
Tip: Machine Language: The language used in computer hardware. It has only zeros and ones (0 and 1). This language is far more serious to learn and understand. Machine language is the most circuitry level computer language. 0s represents off state of a switch while 1s represent on state.
Tip: High Level Languages: Programming languages that converts English like words into machine language are known as High Level Programming Languages. To do this, java uses two software elements, Compiler and Interpreter. A high level language allows using vocabulary of reasonable terms, and also allows designing intuitive names to areas of computer memory.
Anyhow, we need to give program description to Java to convert it into machine language (0s and 1s). In JAVA this description is known as ‘Source Code’. A Source Code file has .java extension (Remind: First.java).
We tell Java to convert description into Machine language using ‘JAVAC’ command. Java will convert this into ‘intermediate code’ but not to Machine language. As mentioned earlier, this converting process takes out by two software elements, Compiler and Interpreter. ‘JAVAC’ command will start Compiler and makes .class extension file. This consists of ‘intermediate code’, that means contents of this file are not JAVA or Machine language. Interpreter will convert this file into machine language when you run the program with ‘JAVA’ command. Check the folder where you create First.java. You may see First.class too!
These are the Java program production steps.
- First you create .java file. That is the ‘Source Code’.
- Compile it using JAVAC command and you are compiling it into .class file; known as ‘Intermediate Code’.
- You run the program with JAVA command. Interpreter interprets .class into machine language and run.
Interpreter needs support of JRE (Java Runtime Environment) to complete running process.
No comments:
Post a Comment