Summary
Highlights
Java's popularity stems from its platform independence, achieved by compiling code into bytecode that runs on the Java Virtual Machine (JVM). This allows Java applications to run on various devices.
In the early 1990s, James Gosling and his team started developing Java (originally named 'Oak') to address the need for a platform-independent language. It officially became Java in 1995.
Java is widely used in Android development, web applications, gaming, and embedded systems. It features automatic memory management, enhancing security, and emphasizes 'Write once, run everywhere' due to its platform independence.
Java is an object-oriented programming language. A class is a template and encapsulates state (attributes) and behavior (methods). An object is an instance of a class, created using the 'new' keyword along with a constructor.
A basic Java program starts with defining a class. The `public static void main(String[] args)` method is the entry point. `System.out.println()` prints output to the console. Explanation of access specifiers (public, private, protected, default) and the 'static' keyword are provided.
Java code is compiled into bytecode using `javac filename.java`, and then executed using `java filename`.