2. • Java is an object-oriented programming language developed
by Sun Microsystems, and it was released in 1995.
• James Gosling initially developed Java in Sun
Microsystems (which was later merged with Oracle
Corporation).
• Java is a set of features of C and C++. It has obtained its
format from C, and OOP features from C++.
• Java programs are platform independent which means they
can be run on any operating system with any processor as long
as the Java interpreter is available on that system.
• Java code that runs on one platform does not need to be
recompiled to run on another platform; it's called write once,
run anywhere(WORA).
• Java Virtual Machine (JVM) executes Java code, but it has
been written in platform-specific languages such
as C/C++/ASM, etc. JVM is not written in Java and
hence cannot be platform independent, and Java interpreter is
a part of JVM.
3. TYPES OF JAVA APPLICATIONS
• Web Application - Java is used to create server-side web applications.
Currently, Servlet, JSP, Struts, JSF, etc. technologies are used.
• Standalone Application - It is also known as the desktop application or
window-based application. An application that we need to install on every
machine or server such as media player, antivirus, etc. AWT and Swing are
used in java for creating standalone applications.
• Enterprise Application - An application that is distributed in nature, such
as banking applications, etc. It has the advantage of the high-level security,
load balancing, and clustering. In Java, EJB is used for creating enterprise
applications.
• Mobile Application - Java is used to create application software for mobile
devices. Currently, Java ME is used for building applications for small
devices, and also Java is a programming language for Google Android
application development.
4. Java Virtual Machine
• Java Virtual Machine (JVM) is a virtual machine
that resides in the real machine (your computer)
and the machine language for JVM is byte code.
This makes it easier for compiler as it has to
generate byte code for JVM rather than different
machine code for each type of machine. JVM
executes the byte code generated by compiler and
produce output. JVM is the one that makes java
platform independent.
5. • So, now we understood that the primary function of
JVM is to execute the byte code produced by
compiler.
• Each operating system has different JVM,
however the output they produce after execution
of byte code is same across all operating systems.
• Which means that the byte code generated on
Windows can be run on Mac OS and vice versa. That
is why we call java as platform independent language.
6. • The Java Virtual machine (JVM) is the virtual
machine that runs on actual machine (your computer)
and executes Java byte code.
• The JVM doesn’t understand Java source code, that’s
why we need to have javac compiler that compiles
*.java files to obtain *.class files that contain the byte
codes understood by the JVM.
• JVM makes java portable (write once, run anywhere).
Each operating system has different JVM, however
the output they produce after execution of byte code
is same across all operating systems.