Java ยท Chapter 1 of 42

Java Introduction

Java is a general-purpose, object-oriented programming language created by James Gosling at Sun Microsystems in 1995. It follows the philosophy of 'Write Once, Run Anywhere' because Java code compiles to bytecode that runs on the Java Virtual Machine (JVM) on any platform.

Java is extremely popular for enterprise applications, Android apps, and is a top language tested in placement interviews for its strong OOP fundamentals.

Syntax
public class Main {
  public static void main(String[] args) {
    // code
  }
}

Why learn Java?

Java teaches strong object-oriented concepts, is widely used in enterprise backends, Android development, and is one of the most commonly asked languages in campus placements and coding interviews.

Where is Java used?

Banking systems, Android apps, large enterprise applications, web servers, and big data tools like Hadoop are all built with Java.

Example 1 (java)
public class Main {
  public static void main(String[] args) {
    System.out.println("Hello, World!");
  }
}
Output
Hello, World!

This prints text to the console using System.out.println.

Key points

  • Java was created by James Gosling in 1995.
  • Java code compiles to platform-independent bytecode.
  • The JVM lets Java run on any OS.
  • Java is heavily used in enterprise and Android development.
๐Ÿ’ก Note: Java's 'Write Once, Run Anywhere' principle is enabled by the JVM.

๐Ÿ“ Quick Quiz

1. Who created Java?

2. Java code compiles to:

3. What does JVM stand for?