Unit-1 Java's Magic PDF

Document Details

EnchantingMeerkat1543

Uploaded by EnchantingMeerkat1543

HNGU, Patan

Dr. Biren Patel

Tags

Java programming object-oriented programming computer science programming languages

Summary

This document provides an introduction to Java, including its history, features, and the Java compilation process. It details the concept of bytecode and the Java Virtual Machine (JVM).

Full Transcript

403- Object Oriented Programming with Java Unit-1 Java's Magic Dr. Biren Patel Associate Professor, Department of Computer and Information Technology, HNGU, Patan -- -- What is Java? ============= Java is a high-level, object-oriented programming language developed by **Sun Microsystems** (...

403- Object Oriented Programming with Java Unit-1 Java's Magic Dr. Biren Patel Associate Professor, Department of Computer and Information Technology, HNGU, Patan -- -- What is 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 has since become one of the most widely used programming languages in the world. Brief History of Java --------------------- **1991: The Birth of Java (Project Green)** - Java was originally conceived by James Gosling, Mike Sheridan, and Patrick Naughton under the project name \"Green.\" - The language was initially called Oak, named after an oak tree outside Gosling\'s office. **1995: Java is Officially Released** - Oak was renamed to Java due to trademark issues. - Java was officially launched with the tagline *\"Write Once, Run Anywhere\" (WORA)* to emphasize its platform independence. **1996: Java Development Kit (JDK) 1.0** - The first official version of Java, JDK 1.0, was released. - This version introduced core features like applets and basic APIs. **1997: Oracle Joins the Java Community** - Oracle became a major contributor to the development and adoption of Java. **2006: OpenJDK Released** - Sun Microsystems made Java open source by releasing the OpenJDK under the GNU General Public License. - OpenJDK is released under the **GNU General Public License (GPL)** **2010: Oracle Acquires Sun Microsystems** - Oracle Corporation acquired Sun Microsystems and took over Java\'s development. Features of Java ================ - **Platform Independent:** Java follows the principle of \"write once, run anywhere.\" Programs written in Java are converted into bytecode, which can run on any system with a Java Virtual Machine (JVM), regardless of the operating system or hardware. - **Simple:** Java is easy to learn and use, especially for programmers with experience in C++ or object-oriented programming. Its clean syntax and straightforward structure make it accessible and efficient. - **Object-Oriented:** Java uses an object-oriented approach, focusing on objects and their interactions. It balances flexibility by treating basic data types like integers as non-objects for better performance. - **Robust:** Java ensures reliability by managing memory automatically using garbage collection and reducing errors with strong type checking and exception handling. This makes programs less prone to crashes or bugs. - **Multithreaded:** Java supports multithreaded programming, allowing multiple tasks to run simultaneously. Its built-in tools make it easy to create interactive and efficient applications. - **Interpreted & High Performance:** Java compiles code into bytecode, which runs on the JVM. Performance is boosted with Just-In-Time (JIT) compilers that convert bytecode into machine code as needed. - **Distributed:** Java is built for internet-based environments, supporting TCP/IP protocols and features like Remote Method Invocation (RMI) for executing methods across networks. - **Dynamic:** Java provides run-time information about objects, enabling safe and efficient updates to code. This allows programs to adapt and evolve while running. Java's Magic -- Bytecode ======================== When we write a Java program, it's not directly converted into machine code (executable code), it is translated into **bytecode**. **Java Bytecode** is an intermediate, platform-independent code of a Java program. When a Java source file (.java) is compiled, it is converted into bytecode (.class file) by the **Java Compiler (javac)**. This.class file is known as Bytecode. Bytecode is a set of instructions that is executed (interpreted/run) by the **Java Virtual Machine (JVM)** on various platforms**.** Java Compilation Process ========================

Use Quizgecko on...
Browser
Browser