Java Introduction
Understanding Java programming language fundamentals
☕ What is Java?
Java is a high-level, object-oriented programming language developed by Sun Microsystems. It's platform-independent, secure, and widely used for enterprise applications, mobile development, and web services.
// Simple Java class example
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java Programming!");
}
}
Output:
Welcome to Java Programming!
Java History
1995
Java was created by James Gosling
// Originally called "Oak"
Sun Microsystems
Developed by Sun, now owned by Oracle
// "Write Once, Run Anywhere"
Popular
One of the most used languages
// Billions of devices run Java
Evolving
Regular updates and improvements
// Java 8, 11, 17, 21...
🔹 Java Characteristics
Key features that make Java powerful:
🔸 Simple and Familiar
Java syntax is similar to C++ but simpler and cleaner.
// Easy to read and write
int age = 25;
String name = "John";
System.out.println("Hello " + name);
🔸 Object-Oriented
Everything in Java is an object (except primitives).
// Class and object example
class Student {
String name;
int age;
}
🔸 Platform Independent
Java bytecode runs on any system with JVM.
// Compile once: javac Program.java
// Run anywhere: java Program
🔹 Java Virtual Machine (JVM)
The JVM makes Java platform-independent:
// Java Source Code (.java)
public class Example {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
// ↓ Compiled to Bytecode (.class)
// ↓ JVM interprets bytecode
// ↓ Runs on any operating system
Process:
1. Write Java code (.java file)
2. Compile to bytecode (.class file)
3. JVM executes bytecode
4. Program runs on any platform
🔹 Java Editions
Java comes in different editions for different purposes:
☕ Java SE
Standard Edition
Core Java for desktop applications
// Basic Java programming
🌐 Java EE
Enterprise Edition
For web and enterprise applications
// Servlets, JSP, EJB
📱 Java ME
Micro Edition
For mobile and embedded devices
// Mobile applications