JavaAssignment 1
JavaAssignment 1
Ans1:-
Java is a high-level, class-based, object-oriented programming language. Key features include:
- Platform Independence
- Object-oriented: Supports OOP principles like inheritance, encapsulation, and polymorphism.
- Robust: Provides exception handling and memory management through garbage collection.
- Secure to use
- Multithreaded: Allows concurrent execution of multiple threads.
- High Performance: Uses Just-In-Time (JIT) compiler for optimization
Ans2:-
1) Classloader
Classloader is a subsystem of JVM which is used to load class files. Whenever we run the java
program, it is loaded first by the classloader. There are three built-in classloaders in Java.
2) Class(Method) Area
Class(Method) Area stores per-class structures such as the runtime constant pool, field and
method data, the code for methods.
3) Heap
It is the runtime data area in which objects are allocated.
4) Stack
Java Stack stores frames. It holds local variables and partial results, and plays a part in method
invocation and return.
7) Execution Engine
It contains:
Ans4:-
Java supports the following data types:
- Primitive Data Types:
- byte
- short
- int
- long
- float
- double
- char
- boolean
- Non-Primitive Data Types:
- String, Arrays, Classes, Interfaces, etc.
Ans5:-
Java supports the following types of operators:
1. Arithmetic Operators: +, -, *, /, %
Example: int sum = 5 + 3;