Computer Science Faculty: Nangarhar University
Computer Science Faculty: Nangarhar University
Date: 02/11/2019
Prepared by: Amin Gul Zakhil
Contents
• What is Java?
• How to Get Java
• Compare Java and C++
• Compiling and Interpreting Applications
• The JDK Directory Structure
• A First Java Program
What is Java
"Java, whose original name was Oak, was developed as a part of the Green
project at Sun. It was started in December '90 by Patrick Naughton, Mike
Sheridan and James Gosling and was chartered to spend time trying to figure
out what would be the "next wave" of computing and how we might catch it.
They came to the conclusion that at least one of the waves was going to be the
convergence of digitally controlled consumer devices and computers. "
Compiling and Interpreting java
• Executing program
• Computer can only execute the code in binary form
• A program written in high-level language is called a source program or source
code.
• Because a computer cannot understand a source program, a source program
must be translated into machine code for execution.
• A translation can be done using another programming tool called interpreter
or compiler
Compiling and Interpreting java
• What is a compiler
• A compiler translate the entire code into a machine-code file to any
intermediate code, and that file is then executed.
Compiling and Interpreting java
• What is an interpreter
• An interpreter read one statement from the source code, translate it to
machine code or virtual machine code, and then execute it right away.
How Java works?
How Java works?
/**
* A simple program
*/
class body
}
Comments