|
Java features
|
What is Java?
u
Java is a programming language that:
n
Is exclusively object
oriented
n
Has full GUI
support
n
Has full network
support
n
Is platform
independent
n
Executes stand-alone
or “on-demand” in web browser as applets
Features of JAVA
- Simple
- Secure
- Portable
- Object-oriented
- Robust
- Multithreaded
- Architecture-natural
- Interpreted
- High performance
- Distributed
- Dynamic
- Simple
v Java was
designed to be easy for the professional programmer to learn and use
effectively.
v Assuming
that you have some programming experience, you will not find java hard to
master.
v If you
already understand the basic concepts of object oriented programming, learning
java will be even easier.
v If you
are an experienced C++ programmer, moving to java will require very little
effort. Because java inherits the C/C++ syntax and many of the object oriented
features of C++, most programmers have little trouble learning Java.
- Security
v Security
is the benefit of java. Java system not only verifies all memory access but
also ensure that no viruses are communicated with an applet.
3.
Portable
The most significant
contribution of java over other language is its portability.
Java
programs can be easily moved from one computer system to another.
Java
ensures portability in two ways:
1. Java
compiler generates byte code instruction that can be implemented on any
machine.
2. The size
of the primitive data types is machine-independent.
- Object-Oriented
vJava is a true object oriented language. All program
code and data reside within object and classes. The object model in java is
simple and easy to extend.
- Robust(healthy, strong)
v The multiplatform environment of the Web places
extraordinary demands on a program, because the program must execute reliably
in a variety of systems. Thus, the ability to create robust programs was given
a high priority in the design of java.
v To gain reliability, java has strict compile time and
run time checking for codes.
v To better understand how java is robust, consider
two main reasons for program failure: memory management mistakes and
mishandled exceptional conditions.
- Multithreaded
v Java was designed to meet the real-world requirement
of creating interactive, networked programs.
v To accomplish this, java supports multithreaded
programming, which allows you to write programs that do many things
simultaneously.
v The java run-time system comes with an elegant yet
sophisticated solution for multiprocess synchronization that enables you to
construct smoothly running interactive systems.
v Java’s easy to use approach to multithreading allows
you to think about the specific behavior of your program, not the multitasking
subsystem.
- Architecture-Neutral
v A central
issue of java programmers was that code longevity and portability. One of the main problems facing programmers is that no
guarantee exists that if you write a program today, it will run tomorrow- even
on the same machine.
v Operating system upgrades, and changes in core
system resources can al combine to make a program malfunction.
v The java designer made several hard decisions in the
java language and the java virtual machine in an attempt to alter this
situation. Their goal was “write once; run anywhere, any time, forever.”
- Interpreted
v Usually a computer language is either compiled or
interpreted. Java combines these approaches thus making java a two-stage
system.
v Java compiler translates source code into byte code
instructions. Byte codes are not machine instructions and so java interpreter
generates machine code that can be directly executed by the machine that is
running the java program.
v We can thus say that java is both a compiled and an
interpreted language.
- High Performance
Java
performance is impressive for an interpreted language, mainly due to the use of intermediate byte code.
- Distributed
v Java is designed for the distributed environment of
the Internet, because it handles TCP/IP protocols.
v Java also supports Remote Method Invocation
(RMI). This feature enables a program to invoke methods across a network.
- Dynamic
v Java is capable of dynamically linking in new class
libraries, methods and object.
v Java can also determine the type of class through a
query, making it possible to either dynamically link or abort the program.