Topic 1: Introduction to Java

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:

  1. Source program: A program written in Java, taking into consideration the rules and syntax of the language, is called source program.
  2. 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.
  3. Byte-code: The code that is created by the compiler and which is executed by the interpreter.
  4. Interpreter: The interpreter loads the byte-code into the main memory for execution.
  5. The final step is to execute the program.

The Basics of a Java Program
Program
    1. public class Hello{
    2. public static void main(String args[]){
    3. System.out.println("Welcome to Java Programming!");
    4. }
    5. }
On execution, the following line will be printed on the screen:
  • 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:
  1. Netbeans can be obtained from the official website: https://netbeans.apache.org
  2. It can be installed on Windows by following the steps outlined in the following video: https://www.youtube.com/watch?v=VjId11SPrsA