Formal Definition: Java is a high-level, object-oriented programming language designed for versatility, readability, and portability. Developed by Sun Microsystems (now owned by Oracle) in 1995, Java is widely used for building platform-independent applications.
Key feature include:
Platform independent: Java follows “Write Once, Run Anywhere” (WORA). Java code is compiled into bytecode by the Java Complier, which is executed on any device with JVM(Java Virtual Machine).
Object-Oriented: Java has a feature of creating objects extensively, making it easier to model real-world entities. The core concepts include Class, Object, Inheritance , Polymorphism, Abstraction, Encapsulation.
Robust and Secure: Java provides Strong memory management, exception handling and runtime checking which makes it robust. Security features such as Java Sandbox and bytecode verifier, which protect against vulnerabilities.
Multithreading:
Java allows concurrent execution of threads, making it suitable for applications requiring parallelism.Dynamic and Extensible:
Java can dynamically load classes and supports extensions via third-party libraries.
Example:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
This example prints "Hello, World!" to the console.