Module_1_Introduction_to_Java
Module_1_Introduction_to_Java
1. Java Basics
- Disadvantages: Slower performance compared to languages like C++ due to JVM overhead.
2. Execution Process
- Java source code (.java) is compiled into bytecode (.class) using the Java Compiler (javac).
- JVM (Java Virtual Machine) interprets or compiles bytecode to native machine code using the JIT
compiler.
3. JVM Internals
- Bytecode Verifier: Ensures code is safe and follows Java security rules.
- JIT Compiler: Converts bytecode to machine code at runtime for better performance.
4. Programming Fundamentals
- Running Java Programs: Installation, IDE setup, writing and running the first program.
- Scanner Class: Used for handling user input from the console.
- Variables: Declaration, initialization, and use of types (int, float, etc.), use of 'final' keyword.
- Type Casting:
- Implicit (Widening): Automatic conversion from smaller to larger data type (e.g., int to double).
- Explicit (Narrowing): Manual conversion from larger to smaller data type (e.g., double to int).