Intro To Java
Intro To Java
SJEFF
Chapter 1: Introduction to Java Platform
What is Java?
Java is a programming language and a computing platform for application development. It
was first released by Sun Microsystem in 1995 and later acquired by Oracle Corporation. It is
one of the most used programming languages.
What is Java Platform?
Java platform is a collection of programs that help to develop and run programs written in
the Java programming language. Java platform includes an execution engine, a compiler,
and a set of libraries. JAVA is platform-independent language. It is not specific to any
processor or operating system. To understand JAVA programming language, we need to
understand some basic concept of how a computer program can run a command and
execute the action.
What is PC?
Like the C compiler, the Java compiler does not produce native executable code for a
particular machine. Instead, Java produces a unique format called bytecode. It
executes according to the rules laid out in the virtual machine specification. Therefore,
Java is a platform-independent language.
Bytecode is understandable to any JVM installed on any OS. In short, the java source
code can run on all operating systems.
Summary:
• ava is a multi-platform, object-oriented, and network-centric programming language Java is a general-purpose, class-based, object-
oriented programming language.
• Java Platform is a collection of programs that help programmers to develop and run Java applications efficiently.
• Meaning of Java: Java is a multi-platform and network-centric programming language.
• It is mainly used for developing Android Apps and Enterprise Software.
• 2009, Oracle Corporation acquired Sun Microsystems and took ownership of three key Sun software assets: Java, Solaris, and MySQL.
• The latest version of Java released on September 15th, 2020
• The best feature of the Java is that it is one of the easiest programming languages to learn.
• Four types of Java Programming language platforms are: 1) Java Platform, Standard Edition (Java SE) 2) Java Platform, Enterprise Edition
(Java EE) 3) Java Platform, Micro Edition (Java ME) 4) JavaFX
• A computer is an electronic device capable of performing computations.
• The computer only understands electronic signals or binary signals.
• Assembler is an advanced technology that converts source core to corresponding machine code (110001..) and feeds to your processor.
What is JVM (Java Virtual Machine):
Architecture Explained!
What is JVM?
Java Virtual Machine (JVM) is a engine that provides runtime environment to drive the
Java Code or applications. It converts Java bytecode into machines language. JVM is a
part of Java Runtime Environment (JRE). In other programming languages, the
compiler produces machine code for a particular system. However, Java compiler
produces code for a Virtual Machine known as Java Virtual Machine.
How JVM Works?
1) ClassLoader
The class loader is a subsystem used for loading class files. It performs three major functions viz. Loading, Linking, and
Initialization.
2) Method Area
JVM Method Area stores class structures like metadata, the constant runtime pool, and the code for methods.
3) Heap
All the Objects, their related instance variables, and arrays are stored in the heap. This memory is common and shared across
multiple threads.
4) JVM language Stacks
Java language Stacks store local variables, and it’s partial results. Each thread has its own JVM stack, created simultaneously
as the thread is created. A new frame is created whenever a method is invoked, and it is deleted when method invocation
process is complete.
5) PC Registers
PC register store the address of the Java virtual machine instruction which is currently executing. In Java, each thread has its
separate PC register.
JVM Architecture
In order to write and execute a software program, you need the following
1) Editor – To type your program into, a notepad could be used for this
2) Compiler – To convert your high language program into native machine code
3) Linker – To combine different program files reference in your main program together.
4) Loader – To load the files from your secondary storage device like Hard Disk, Flash Drive,
CD into RAM for execution. The loading is automatically done when you execute your code.
5) Execution – Actual execution of the code which is handled by your OS & processor.
With this background, refer the following video & learn the JVM internal working and
architecture of JVM (Java Virtual Machine).
C code Compilation and Execution process
• Full form of JVM is Java Virtual Machine. JVM in Java is the engine that drives the Java
Code. It converts Java bytecode into machines language.
• JVM architecture in Java contains classloader, memory area, execution engine etc.
• In JVM, Java code is compiled to bytecode. This bytecode gets interpreted on different
machines
• JIT stands for Just-in-time compiler. JIT is the part of the Java Virtual Machine (JVM). It
is used to speed up the execution time
• In comparison to other compiler machines, JVM in Java may be slow in execution.