Java Introduction
What is Java?
Output:
Java is a high-level, object-oriented programming language used to build everything from desktop applications to mobile apps, enterprise systems, and cloud-based services.
Originally developed by James Gosling in 1995 at Sun Microsystems (now owned by Oracle), Java is known for its philosophy:
Write Once, Run AnywhereThis means code written in Java can run on any system that has a Java Virtual Machine (JVM), without modification.
Key Features of Java
- Platform Independent – Runs on Windows, Mac, Linux, etc. No need to change code for different systems.
-
Object-Oriented – Everything is based on classes and objects, making code reusable and easy to manage.
-
Secure & Robust – Offers strong memory management, built-in security, and exception handling.
-
Multithreaded – Supports running multiple tasks simultaneously for better performance.
- Massive Community Support – Backed by millions of developers, a rich ecosystem of tools, and countless libraries/frameworks.
How Java Works
- Write Code – You write your code in a .java file.
- Compile – The javac compiler converts your code into bytecode (.class file).
- Execute – The JVM (Java Virtual Machine) runs the bytecode on any platform.
Tip: You do not need to memorize the code execution process. The Java compiler and JVM handle it for you!
Your First Java Program
Here is a simple Java program that prints "Hello, Java!" to the screen:
Here is a simple Java program that prints "Hello, Java!" to the screen:
// First Java Programpublic class HelloJava { public static void main(String[] args) { System.out.println("Hello, Java!"); }}
Output:
Hello, Java!
Where is Java Used?
Java powers many real world applications, including:
Java powers many real world applications, including:
- Web Development: Frameworks like Spring Boot and Hibernate
- Android Development: Apps built with Java and Kotlin
- Enterprise Software: Banking systems, CRM, ERP solutions
- Game Development: Popular games like Minecraft and Runescape
- Cloud & Big Data: Technologies like Hadoop and Apache Spark
Two Minute Drill
- Java is powerful and object oriented.
- Write once, run anywhere with the help of JVM.
-
Secure and reliable with automatic memory management.