Introduction To Java
Introduction To Java
a. Console based Java Applications : A console based Java application uses a text-only
interface. Windows command prompt or cmd is an example of console-based
application.
b. GUI Based Java Applications : A GUI based application uses a Graphical User
Interface (GUI) like buttons, text fields, mouse pointer etc. Windows calculator is an
example of GUI based application.
2. JAVA APPLETS OR JAVA INTERNET APPLETS – Java Applets are Java programs that runs
on the web browser. An applet is capable of performing tasks on a web page like
displaying graphics, playing sounds, accepting user inputs, etc.
COMPILER : A compiler is a program that converts a program written in high-level language into
machine-level language all at once.
• A Java program is written as a source code file that has a “.java” extension.
• The Java compiler takes this file and converts it to an intermediate code all at once called
Bytecode that is machine independent. This Bytecode file has a “.class” extension.
• This Bytecode “.class” file is machine independent code and it can run on any device that
has JRE (Java Runtime Environment) and JVM (Java Virtual Machine) installed in it.
• The JRE (Java Runtime Environment) consists of the JVM (Java Virtual Machine) and
many other library classes.
• The JVM (Java Virtual Machine), which is comprised of Java Interpreter and JIT (Just-in-
time) compiler, picks up this Bytecode file.
• The JIT (Just-in-time) compiles selected portions of the code into machine-code. The
rest of the code is simply interpreted. This machine-code is also known as Object code.
Structure of JRE :
Java Interpreter
JVM ( Java
JRE (Java Virtual Machine)
JIT (Just-in-time)
Runtime
compiler
Environment) Java Class
Libraries
JAVA COMPILATION PROCESS :
FEATURES OF JAVA :
• Simple : Java is a simple and easy to learn programming language.
• Robust : Java is a robust and reliable language as compiler and interpreter checks and
catch errors.
• Secure : Java is secure because it allows Applets to confine to the Java runtime
environments only.
• Object Oriented : Java is a true object-oriented program as it treats everything as an
object.
• Platform Independent : The concept of “Write once run anywhere” (WORA) is one of
the most important features of Java, which makes it a very powerful language. Java
applications can run on any platform that has a JVM installed on it.
• Multi-threaded : Java is also a multithreaded language, that means multiple processes
can run on one compiler.