Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
21 views

Introduction To Java

Java is an object-oriented programming language created in 1991. It can be used to create standalone applications, applets that run in web browsers, and many other types of programs. Java programs are compiled into bytecode that can run on any system with a Java Virtual Machine. The JVM interprets the bytecode and may compile portions of it to native machine code for improved performance. This makes Java programs platform independent and able to run on Windows, macOS, Linux and more.

Uploaded by

ROHIT DSUZA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Introduction To Java

Java is an object-oriented programming language created in 1991. It can be used to create standalone applications, applets that run in web browsers, and many other types of programs. Java programs are compiled into bytecode that can run on any system with a Java Virtual Machine. The JVM interprets the bytecode and may compile portions of it to native machine code for improved performance. This makes Java programs platform independent and able to run on Windows, macOS, Linux and more.

Uploaded by

ROHIT DSUZA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Chapter 2 – INTRODUCTION TO JAVA

Short-note/ History of Java :


1. Java is third generation Object-oriented programming language.
2. It was started as a project called “Oak” by James Gosling in 1991 at Sun Microsystems.
3. Later Oak was renamed as Java and formally released in 1995.
4. Java can be used to create user-friendly computer applications that can run on a stand-
alone machine.
5. Java can also be used to build application modules, Internet applets, and many more.

Types of Java programs :


1. STAND ALONE JAVA APPLICATIONS – A stand-alone Java application refers to a Java
program that can run independently on a computer. Microsoft word is an example of
stand-alone application.

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.

SOME IMPORTANT DEFINATIONS :


HIGH-LEVEL LANGUAGE : A high level language is a programming language in which we write
the programs and easy for us to understand. A program or a set of instructions written in high-
level language is known as Source Code.
MACHINE-LEVEL LANGUAGE : A low-level language that is understood by the computers is
known as Machine language. Machine language is a set of instructions or programs written in
ASSEMBLY LANGUAGE : Writing programs in machine language was tedious and was prone to
errors, very difficult to understand , read and modify. To overcome these issues, assembly
languages were developed which allowed the programs to be written using symbolic operations
called mnemonic codes.

COMPILER : A compiler is a program that converts a program written in high-level language into
machine-level language all at once.

INTERPRETER : A interpreter is a program that converts a program written in high-level


language into machine-level language line-by-line.

ASSEMBLER : A assembler is a program that converts a program written in assembly-level


language into machine-level language.

JAVA COMPILATION PROCESS : (Very important)

• 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 :

JVM (Unix) Java


Object
Virtual
Java Source Bytecode(.class JVM (Windows) Code
Code (.java file)
Java Compiler
file) Machine

JVM (Mac OS)

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.

You might also like