#CoreJava/IntroductionOfJava

What is Java?

?

Why use java? or List the features of Java programming language.

?

Applications of Java

?

Why is Java not a pure object-oriented language?

?

What is Architecture neutral?

?

CORA OR WORA

?

Why java is a dynamic programming language?

?

How to run Java on your system?
How Java works

?

Java Mechanism.png
Java compilation and execution process:
  1. Compile the Java file with javac filename.java to create bytecode (.class file).
  2. Run the bytecode with java filename, which sends it to the JVM.
  3. The JVM converts the bytecode into machine code and executes the program to produce the output.
Main Function

?

JDK

?

JRE

?

JVM

?

Compiler

?

Compilation Time

?
The time taken to convert the entire source code into bytecode.

Execution (or Runtime)

?
The process of converting the .class file (bytecode) into binary or machine code and running the program with the given input.

Interpreter

?

JIT

?

Garbage Collector

?

Features of garbage collector

?
The features of garbage collection in Java are:

  1. Automatic Memory Management: It automatically frees up memory by removing objects that are no longer in use.
  2. No Manual Deallocation: Developers don't need to manually release memory, reducing errors.
  3. Handles Circular References: It can detect and remove objects that reference each other but are no longer needed.
Allocate and Deallocate Memory

?
In Java, memory is managed automatically:

  1. Allocate Memory: Use the new keyword to create objects, which allocates memory from the heap.

    • Example: Person p = new Person();
  2. Deallocate Memory: Java uses Garbage Collection to automatically free memory for objects that are no longer used, so you don’t need to manually deallocate it.

Byte Code

?

Why java is a secured language?

?

Java is robust nature, how?

?