Java is a object-oriented language. All Java code has to be written in class declarations. The
Java code is compiled using a compiler, and the generated byte-code is interpreted by the java
interpreter.
The interpreter is called the Java Runtime Environment (JRE). The development environment is
called the Java Development Kit (JDK).
Processing a Java Program
There are five steps to execute a program written in a Java program:
- Source program: A program written in Java, taking into consideration the
rules and syntax of
the language, is called source program.
- Compiler: The compiler checks the syntax and then, if correct, translates
the source program into machine language program. The programs that we write in a high-level
language are developed using a software development kit (SDK). The SDK contains many
programs that are useful while creating your program.
Once the program is developed and successfully compiled, we must still bring the code for
the resources used from the SDK into our program to produce a final program that the
interpreter can execute.
- Byte-code: The code that is created by the compiler and which is executed
by the interpreter.
- Interpreter: The interpreter loads the byte-code into the main memory for
execution.
- The final step is to execute the program.
The Basics of a Java Program
-
- public class Hello{
- public static void main(String args[]){
- System.out.println("Welcome to Java
Programming!");
- }
- }
-
Welcome to Java Programming
Integrated Development Environment (IDE)
An integrated development environment (IDE) is a software application that provides necessary
tools for computer programmers for software development. It contains both an editor and a
compiler. Some examples of Eclipse, NetBeans, BlueJ, JDeveloper, IntelliJ IDEA, Android Studio
etc. For this tutorial, we would be using NetBeans.
Netbeans IDE:
- Netbeans can be obtained from the official website: https://netbeans.apache.org
- It can be installed on Windows by following the steps outlined in the following video:
https://www.youtube.com/watch?v=VjId11SPrsA