Wednesday 1 May 2013

Java Introduction-1

The Creation of Java

Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and
Mike Sheridan at Sun Microsystems, Inc. in 1991. It took 18 months to develop the first
working version. This language was initially called “Oak” but was renamed “Java”
in 1995. Between the initial implementation of Oak in the fall of 1992 and the public
announcement of Java in the spring of 1995, many more people contributed to the design
and evolution of the language. Bill Joy, Arthur van Hoff, Jonathan Payne, Frank Yellin,
and Tim Lindholm were key contributors to the maturing of the original prototype.

• Java is an object-oriented language similar to C++.
• Simplified to eliminate C++ language features that cause common programming errors.
• Java source code files (files with a .java extension) are compiled into a format called bytecode (files with a .class extension).
• Class files can then be executed by a Java interpreter.
• Compiled Java code can run on most computers because Java interpreters and runtime environments, known as Java Virtual Machines (VMs), exist for most operating systems.
• Bytecode can also be converted directly into machine language instructions by a just-in-time compiler (JIT).

FEATURES OF JAVA
Simple & Powerful
Secure
Portable
Object-oriented
Robust
Multithreaded
Architecture-neutral
Interpreted & High Performance
Distributed
Dynamic

Simplicity
• Almost everything is an object
• All objects on heap, accessed through pointers
• No functions, no multiple inheritance, no go to, no
operator overloading, few automatic coercions
Portability and network transfer

• Bytecode interpreter on many platforms
Reliability and Safety

• Typed source and typed bytecode language
• Run-time type and bounds checks
 
Two Paradigms
  1. Procedure-oriented Programming
  2. Object-oriented Programming
As you know, all computer programs consist of two elements: code and data. Furthermore,
a program can be conceptually organized around its code or around its data. That is,
some programs are written around “what is happening” and others are written around
“who is being affected.” These are the two paradigms that govern how a program is
constructed.

The first way is called the process-oriented model. This approach characterizes
a program as a series of linear steps (that is, code). The process-oriented model can be
thought of as code acting on data. Procedural languages such as C employ this model to
considerable success.

The second approach, called object-oriented programming, was conceived.
Object-oriented programming organizes a program around its data (that is, objects) and a
set of well-defined interfaces to that data. An object-oriented program can be characterized
as data controlling access to code.

Procedure-oriented Programming
• Organizes a program around its procedure
• Emphasis of a program is on how to accomplish a task
• User has little, if any, control
• Follows bottom-up approach

Object-oriented Programming
• A program around its data & a set of well-defined interfaces to that data.
• Emphasis on data rather than procedure
• Programs are divided into Objects (relevant real-world objects )
• Data is hidden and cannot be accessed by external functions
• Objects can communicate with each other through functions
• New data and functions can be easily added whenever necessary
• User has a lot of control
• Follows bottom-up approach

0 comments:

Post a Comment