Introduction to Java
Java is a high-level, object-oriented programming language developed by
Sun Microsystems (now owned by Oracle Corporation). It was
released in 1995 and is designed to have as few implementation
dependencies as possible, which makes it platform-independent —
meaning Java programs can run on any device that has the Java Virtual
Machine (JVM).
🔑 Key Features of Java
1 Simple and Easy to LearnJava has a clean syntax similar to C++, but
with fewer low-level complexities.
2 Object-OrientedEverything in Java is treated as an object, making it
easier to manage and extend.
3 Platform-Independent (Write Once, Run Anywhere)Java code is
compiled into bytecode, which the JVM interprets. This makes Java
programs run on any system with a JVM.
4 SecureJava has built-in security features such as bytecode verification
and runtime security policies.
5 RobustJava handles memory management and has strong exception-
handling capabilities.
6 MultithreadedJava supports multithreaded programming, enabling you
to write programs that perform many tasks simultaneously.
7 High PerformanceWhile not as fast as C or C++, Java uses Just-In-Time
(JIT) compilers to improve performance.
8 DistributedJava supports networking and can be used to create
distributed applications.
🧱 Basic Structure of a Java Program
java
CopyEdit
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Explanation:
• public class HelloWorld: Defines a class named HelloWorld.
• public static void main(String[] args): The main method
where execution starts.
• System.out.println(...): Prints output to the console.
✅ Java Development Kit (JDK)
To write and run Java programs, you need:
• JDK (Java Development Kit) – includes tools like compiler ( javac) and
JVM.
• IDE (Integrated Development Environment) – e.g., Eclipse, IntelliJ IDEA, or
VS Code.
📚 Common Uses of Java
• Web development (Spring Framework)
• Mobile apps (especially Android)
• Enterprise applications
• Scientific applications
• Embedded systems
• Game development (basic 2D/3D)