Introduction to Java Programming Language
What is Java?
Java is a popular programming language used to create different types of software such as:
-
- Desktop applications
-
- Mobile apps (especially Android apps)
-
- Web applications
-
- Games
-
- Enterprise software
-
- Banking and server-side applications
Java is known for being simple, secure, and reliable.
Who Developed Java?
-
- Java was developed by James Gosling and his team at Sun Microsystems.
-
- It was first released in 1995.
-
- Later, Sun Microsystems was acquired by Oracle Corporation, which now maintains Java.
Why is Java So Popular?
Java is popular because it has many useful features:
-
- Easy to learn for beginners
-
- Object-Oriented Programming language
-
- Platform independent
-
- Secure and robust
-
- Large community support
-
- Used by big companies worldwide
What Does “Platform Independent” Mean?
Java follows the rule:
“Write Once, Run Anywhere” (WORA)
This means:
-
- Java code written on one system (Windows) can run on another system (Linux or macOS) without changing the code.
How is this possible?
Java code is not directly converted into machine code. Instead:
-
- Java source code → compiled into bytecode
-
- Bytecode runs on JVM (Java Virtual Machine)
-
- JVM is available for different operating systems
Basic Java Program Flow (Very Simple)
Java Source Code (.java)
↓
Compiler (javac)
↓
Bytecode (.class)
↓
Java Virtual Machine (JVM)
↓
Output
What is JVM?
JVM stands for Java Virtual Machine.
It is a software that:
-
- Runs Java bytecode
-
- Makes Java platform independent
-
- Manages memory
-
- Handles security
-
- Executes programs
Each operating system has its own JVM.
What is JDK and JRE?
JDK (Java Development Kit)
Used by programmers to write and develop Java programs.
It contains:
-
- Compiler (javac)
-
- JRE
-
- Development tools
JRE (Java Runtime Environment)
Used to run Java programs.
It contains:
-
- JVM
-
- Required libraries
Simple difference:
-
- JDK → for writing + running Java
-
- JRE → only for running Java
Features of Java (Very Important)
1. Simple
Java syntax is easy and readable, similar to English.
2. Object-Oriented
Java is based on objects and classes, which helps in organizing programs properly.
3. Platform Independent
Java programs can run on any operating system.
4. Secure
Java provides strong security using:
-
- Bytecode verification
-
- No direct pointer access
5. Robust
Java handles errors using exception handling and automatic memory management.
6. Multithreaded
Java can perform multiple tasks at the same time.
7. Portable
Java programs can move easily from one system to another.
Where is Java Used?
Java is used in many real-world applications:
-
- Android mobile apps
-
- Banking systems
-
- ATM software
-
- E-commerce websites
-
- Hospital management systems
-
- Enterprise applications
-
- Cloud-based applications
Simple Real-Life Example of Java
Think of Java like a universal electric plug adapter.
-
- Different countries have different sockets
-
- Java works like one adapter that fits everywhere
-
- JVM converts Java code to match the local system
That is why Java is called platform independent.
Summary (Quick Notes for Revision)
-
- Java is a high-level, object-oriented programming language
-
- Developed by James Gosling
-
- Released in 1995
-
- Owned by Oracle
-
- Platform independent
-
- Uses JVM
-
- Follows “Write Once, Run Anywhere”
- Used for web, mobile, and enterprise applications