Programming Languages Assignment
Programming Languages Assignment
class Main{
public static void main(String args[]){
System.out.println(
"@Author : Prashanth Kumar \n"+
"@Roll : 22/11/EC/050 "
);
}
}
Memory Management
In Java, objects are stored in Heap space, while Stack memory contains references to these objects.
Heap memory is used globally, while Stack memory is used by a single execution thread.
Class Loading
The Java Class Loader, part of the JRE, dynamically loads Java classes into the JVM as needed. It
consists of:
Bootstrap Class Loader: Loads core Java libraries.
Extension Class Loader: Loads classes from extension directories.
Application Class Loader: Loads classes from the classpath, including user-defined classes and
libraries.
image source : Google Search
Execution Engine
The Java Execution Engine is responsible for executing Java bytecode, which is the compiled form of
Java source code. The components of the Java Execution Engine include the Class Loader, Bytecode
Verifier, Just-In-Time (JIT) Compiler, and the Java Virtual Machine (JVM).
Platform-independent in terms of
Platform Platform-independent, as
bytecode, but the generated native code
Independence bytecode is executed by the JVM.
is platform-specific.
Feature Interpretation JIT compilation
May have faster startup time, as May have a slight delay in startup time
Startup Time
there is no initial compilation step. due to the compilation process.
The Java Virtual Machine (JVM) is part of the Java Runtime Environment (JRE) that executes Java
bytecode, abstracting the hardware and OS for platform independence. This allows Java applications to
run on any device or OS with a JVM, supporting Java's "write once, run anywhere" principle.
Platform Independence:
JVM executes compiled Java bytecode, not native machine code, making Java a platform-independent
language. This facilitates the portability of Java applications across various platforms.
Method Area: Stores class structures, method data, field data, and static variables.
Heap: Manages object instances memory.
Java Stack: Contains method-specific data, including local variables and partial results.
PC Register: Tracks the program counter, pointing to the current instruction.
Native Method Stack: Stores native method information and data. These areas support memory
allocation and deallocation during program execution.
Garbage Collection:
Garbage collection is an automatic process that reclaims memory from unused objects. Various garbage
collection algorithms exist, each with a different approach to balancing memory reclamation efficiency
and application responsiveness.
Functional Languages:
Functional languages emphasize immutability, first-class and higher-order functions, pure functions,
recursion, and referential transparency. Examples include Haskell, Clojure, and Erlang.
Imperative Languages:
Imperative languages allow mutable state, procedural statements, explicit control flow, and may involve
side effects. They often require explicit synchronization in concurrent settings.
In summary, functional programming promotes immutability and declarative constructs, while imperative
programming allows mutable state and explicit control flow.
Untyped Languages:
Untyped or dynamically typed languages don't require explicit type annotations. Variables can change
types during runtime, offering flexibility and rapid prototyping. However, they may lead to runtime errors
and reduced readability.
Examples:
Examples:
Java: Requires explicit type declarations and performs type checking at compile-time. Used for
enterprise applications and Android development.
C# (C Sharp): Strongly typed and supports static type checking. Used for Windows application
development and game development using Unity.
Swift: A statically typed language combining strong typing with type inference. Used for iOS and
macOS application development.
References
simplesnippets
digital oceam
FreeCodeCamp
AWS
Microsoft