Java Operating System a general purpose OOPL developed by
Sunmicro System(USA) in the year 1991.
Originally it was named as OAK & it was renamed in 1995 as
JAVA can be used to develop two types of programs , these are
Application and Applets.
When we create applications, java is not much different from
other languages. But in case of an applet, it can be dynamically
downloaded across the network, which can react to user input.
To execute an application in java, the following two methods can
be adopted :
* Compiling the source code into the BYTE CODE using the java
compiler, i.e. javac
* Executing the byte code, using the JAVA interpreter, i.e. java
The Source code is compiled by the java compiler. The
output of the compiler is not an executable code.
Rather it is an intermediate code called as the BYTE
The byte code is stored in a file having extension
After byte code is generated by the compiler, it is
interpreted by the JAVA interpreter to produce the
Some of the important features are described below
SIMPLE: java is simple because of the availability of
Object Oriented features in it.
SECURED: When an executable program is
downloaded, the risk of viral infection is severe, which
may infect the system with a virus.
PORTABILITY: Many type of computer with different
OS are available almost all computer are connected to
the internet now a days. Therefore, the code must be
sufficiently portable enough so that it can be
dynamically downloaded to the various platforms.
OBJECT ORIENTED: java is a pure object oriented
programming language. The principle is “everything is
an object” is implemented in java.
ROBUST: java is robust, because it is a strictly typed
language. Due to this, the java compiler checks the
code at compile time to allow the programmer correct
the syntactical errors. It also handles the memory
management mistakes and exceptional condition.
MULTI-THREADED: java supports multi-threaded
programming. Which allow the programmer to write
programs, that may do many things simultaneously.
Though it is a Object oriented Programming Language is
supports the following features
o DATA ABSTRACTION : Abstraction refers to the act of
representing essential features without including the
background the explanation details.
o ENCAPSULATION : the wrapping up of data &
function/methods into a single unit is known as
o MODULARITY : Modularity is the property of system that
has been decomposed into a set of cohesive & loosely
coupled modules. So the act of partitioning program into
individual is called modularity.
o INHERITANCE : It is the capacity of one class of
things to inherit from another class.
o POLYMORPHISM : It is a ability for a data to be
processed in more than one forms. It is a property by
which the same message can be sent to object of
several different classes.
Java Virtual Machine
The java run time system is other wise known as the
Execution of every java program is under the control of
As the source code in JAVA is translated into the byte
code , it becomes easier to run the byte code in a wide
verity of environments.
Only requirement is the availability of JVM within
Command Line Argument
An argument which is supplied/passed to the main()
from the command line at the time of calling the
main() by the java interpreters is called COMMAND
The arguments supplied from the command line are of
string type arguments. Therefore these arguments are
stored in the parameter of main() which is an array of
string objects i.e. args
A class can contain two or more methods with same
name but different set of parameters. In this case the
methods are said to be overloaded & the process is
called method overloading.
In method overloading, methods may or may not have
same return type.
A constructor is a specialize method/member function
A constructor has the same name as the class in which
it is declared.
A constructor is syntactically similar to a method with
only exception that it has no return type not even void.
Once defined in a class, the constructor is
automatically called immediately after the object is
Like method overloading, constructor can also be over
Constructor overloading is the process by which two
or more constructor defined in a class with different
list of parameters.
When overloaded constructor are called, java compiler
calls that constructor whose list of parameter exactly
matches with the values received from the calling
The mechanism of deriving a new class from an
existing class is called inheritance.
The class from which the new class is derived is called
SUPER CLASS and the class which is derived is called
-> The creation of hierarchical classification
When a method in a subclass is exactly same as in
method in a super class, then method overriding takes
In method overriding, the subclass and super class
method have same name, same return type and same
Due to inheritance, the subclass method overrides the
super class method. Therefore when an overridden
method is called from within a subclass, it always
refers to the method define in the sub class
Since java does not support multiple inheritance, it
provides an alternate approach to multiple inheritance
and that approach is Interface.
An interface, is a kind of class that lacks instance
variable and its methods are declared without only
Therefore using an interface, it is specified that what a
class must do but not how it does it.
Variable declared with in a interface must have FINAL
Syntax of declaration of variables
static final <type of variable> <variable name>=<value>
E.g. : static final int a=5;
Syntax of declaration of methods
<return type> <method name>(<parameter list>);
E.g. : float compute(float r);
Package are container for classes, that are used to keep
the class name space compartmentalized
Packages are stored in a hierarchical manner and
packages are explicitly imported into new class
The classes defined inside a package are not accessible
by the code outside that package.
Java provides built in support for multithreaded
A multi threaded programming contains two or more
parts that can concurrently.
Each part of a program is called thread.
Each thread has its own separate path of execution.
Multithreading makes the maximum use of CPU.