Introduction to Java
Java is a high-level, object-oriented
programming language.
It is platform independent and follows Write
Once Run Anywhere.
Java is secure, robust, and widely used.
History of Java
Developed by James Gosling at Sun
Microsystems.
Started in 1991 and officially released in 1995.
Earlier names: GreenTalk, Oak.
Why Java?
Platform independent
Object-oriented
Secure and portable
Huge community support
Features of Java
Simple
Object-Oriented
Robust
Multithreaded
High Performance
Compiled and Interpreted
Java source code is compiled into bytecode.
JVM converts bytecode into machine code.
Platform Independence
Java follows WORA principle.
Same program runs on different OS.
JVM makes it possible.
Java Architecture
Java Architecture consists of:
JVM
JRE
JDK
Java Virtual Machine (JVM)
Executes bytecode
Provides runtime environment
Manages memory
JVM Components
Class Loader
Method Area
Heap
Stack
Garbage Collector
Java Runtime Environment (JRE)
Provides environment to run Java programs.
Includes JVM and libraries.
Java Development Kit (JDK)
Used to develop Java programs.
Includes compiler and tools.
Java vs C++
Java is platform independent.
No pointers in Java.
Automatic garbage collection.
Applications of Java
Mobile Apps
Web Applications
Desktop Applications
Games
Cloud and IoT
First Java Program
class First
{
public static void main(String
args[])
{
[Link]("Welcome to
Java");
}
}
Conclusion
Java is powerful and flexible.
Used across industries.
Foundation for advanced programming.