Java Day 1: Introduction to Java & Setup

Goal of this Day

Today you will learn:

By the end, you will be able to run your first Java program.

Step 1: What is Java?

Java is a popular programming language used for many types of applications.

Examples:

Why use Java?

Step 2: Installing Java (JDK)

To write and run Java programs, you need the Java Development Kit (JDK).

Steps:

Step 3: Setting up an IDE

An IDE (Integrated Development Environment) helps you write code more easily.

Popular IDEs:

Choose one and install it.

Step 4: Structure of a Java Program

Every Java program follows a specific structure.


public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

Explanation:

Practice

Write your first Java program:


public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

Exercise

Modify the program so that it prints:

Example:


public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("My name is Alex");
        System.out.println("I am 16 years old");
        System.out.println("My hobby is programming");
    }
}