Java Introduction
Java Introduction
Features:
1. B
ytecode Verification: When Java source code is compiled,it's translated into
bytecode. Before executing bytecode, the JVM performs bytecode verification to
ensure it adheres to certain safety constraints, preventing various types of
security vulnerabilities such as buffer overflows and invalid memory access.
Verification Process:
Class File Structure Verification: The JVM first verifiesthe structure of the class
file to ensure it conforms to the required format.
ype Safety Verification: This ensures that type safetyis maintained throughout
T
the bytecode. For example, operations are performed on compatible data types
and that type casts are valid.
2. S
andboxing: Java's security model includes a conceptcalled the "sandbox,"
which restricts the actions that Java code can perform. For example, Java
applets running in a web browser operate within a restricted environment
( sandbox) that limits their access to the system resources, such as the file
system or network, mitigating the risk of malicious behavior.
. Secure Standard Library: Java's standard library (JavaAPI) includes
3
security-focused classes and utilities for tasks such as cryptography, secure
communication (e.g., HTTPS), authentication, and authorization, making it easier
for developers to implement secure solutions.
4. String Immunity: In Java, strings are immutable, meaningonce created, they
cannot be modified. This property helps prevent certain types of security
vulnerabilities, such as string manipulation attacks.
. Loading:Loading means reading the .class filedata from hard disk and store corresponding
1
data in method area
For each .class file, JVM will store
Fully qualified class name, fully qualified class name of parent, method and constructor
information, constant pool information
2. Linking:It consist of 3 activities
a) Verification
b) Preparation
c) Resolution
3. Initialization
In this phase, values are assigned to the variablesand the static block will be executed
Method Area
● T he Method Area stores metadata about classes and interfaces, such as the fully
qualified class names, field names, method names, method signatures, access
modifiers, and constant pool information. This metadata is required for proper
class loading, verification, and runtime execution.
● The constant pool, which contains symbolic references, literals, and other
constant values used by the class, is stored in the Method Area. This includes
string literals, numeric constants, class and interface names, method and field
references, and more.
Heap Area
. T
1 he Heap Area is where objects created by Java programs are allocated
2. The Heap Area supports dynamic memory management through garbage
collection.
3. Arrays and strings in Java are also stored in the Heap Area
Execution Engine
xecution Engine
E
Just In Time (JIT) Compiler