The document discusses Java programming language and Java virtual machine (JVM). It states that Java code is compiled into bytecode that can run on any JVM, allowing cross-platform portability. The JVM provides a runtime environment and executes bytecode through its components: the bytecode verifier checks for errors, the class loader loads Java classes, the execution engine interprets bytecode into machine code, the garbage collector automatically frees unused memory, and the security manager monitors for security violations.
Presentation by Mahnoor Hashmi on Java programming language.
Java byte code is the machine language for the JVM, enabling platform independence and execution on any JVM after compilation.
A virtual machine abstracts a program's interface to physical computers; JVM is the runtime engine enabling Java byte code execution.
JVM executes Java byte code, ensuring platform independence, with compiled format in .class files.
Components of JVM include byte code verifier, class loader, execution engine, garbage collector, and security manager to ensure security and manage resources.
Java isa programming language originally
developed by James Gosling at Sun Microsystems.
The language drives much of its syntax from
C and C++ but has a simpler object model.
Java applications are typically compiled to
byte code (class file) that can run on any Java
Virtual Machine (JVM).
4.
Java Byte Code
Byte codes are the machine language of the java
virtual machine. A feature that different the java
with other programming features.
It is a programming code that, once compiled, is run
through a virtual machine.
Byte code is the compiled format for Java programs.
Once a Java program has been converted to byte code,
it can be transferred across a network and executed
by Java Virtual Machine (JVM).
5.
Virtual Machine
o Beforeunderstanding what is JVM let us first
know what is Virtual Machine.
A virtual machine is a layer of abstraction that
gives a program one simplified interface for
interacting with a variety of physical
computers and their operating systems.
6.
Java Virtual Machine
The Java Virtual Machine (JVM) is the runtime engine of
the Java Platform, which allows any program written
in Java or other language compiled into Java byte code to
run on any computer that has a native JVM.
The byte code can be executed on any platform where
there exist JVM. It is available for many hardware and
software platforms.
JVM executes the step-by-step instructions given to
it from the byte code.
JVM providesrun time environment in which java byte code
can be executed.
When program compiles, the java compiler translates the
java source code into a .class file
(byte codes) that contains the compiled version of program.
Byte codes are platform independent and proves Java is an
independent language. JVM can run on different operating
systems.
Java Class File:
Java class file is a file (with the .class extension)
containing a Java byte code which can be
executed on the Java Virtual Machine (JVM).
9.
Components of JVM:
Byte code verifier.
Class loader.
Execution engine.
Garbage collector.
Security manager.
10.
Byte Code Verifier:
Used to verify the byte code.
Checks for unusual code.
A crucial component for security.
11.
Class loader:
Loadsjava classes into JVM.
All JVM include one class loader that is
embedded in the virtual machine.
The main feature of the class loader is that
JVM. doesn’t need to have any knowledge
about the classes that will be loaded at
runtime.
Execution Engine:
Helps JVM to convert byte code into machine
code using interpreter.
12.
Garbage Collector:
Processof automatically freeing objects that are
no longer referenced by the program.
Relieves java programmer from memory
management.
Security Manager:
Monitors the code.
A special java object responsible for guarding
security policies for java applications.