Sunday, April 12, 2015

Java Programming



Why Java is called the Platform Independence?

If the software/program written in particular language for the particular platform run in any other platform without changing the program, then we can say such type of programming language as platform independence i.e. run on any platform without changing the original program.

Java program can be easily moved from one computer system to another, anywhere and anytime.Changes in the operating system,processors and system resources will not force any changes in java program. so the java is the platform independent language.Due to its independence nature java becomes popular language for programming on internet which interconnects different kinds of system worldwide.Java becomes platform independent due to its two properties:

-    Java complier generates bytecode that can be implemented on any machine.
-    The size of primitive data types are machine independent.

Bytecode:
              When the program written in java is compiled, the compiler generates an intermediate code instead of directly to platform specific machine code. This intermediate code is known as bytecode and is machine independent. This byte code is then translated to machine code by a interpreter known as Java virtual machine which is incorporated with every operating system.



Characteristics of Object-Oriented language
– Emphasis is on data rather than procedures.
– Programs are divided into objects.
– Data structures are designed such that they characterize the objects.
– Functions & data are tied together in the data structures so that data abstraction is                introduced in addition to procedural abstraction.
– Data is hidden & can‟t be accessed by external functions.
– Object can communicate with each other through function.
– New data & functions can be easily added.
– Follows Bottom up approach.
Features of Object Oriented Language:
1. Objects Objects are the entities in an object oriented system through which we perceive the world around us. We naturally see our environment as being composed of things which have recognizable identities & behavior. The entities are then represented as objects in the program. They may represent a person, a place, a bank account, or any item that the program must handle. For example Automobiles are objects as they have size, weight, color etc as attributes (ie data) and starting, pressing the brake, turning the wheel, pressing accelerator pedal etc as operation (that is functions).

Features of Object Oriented Language:
Objects are the entities in an object oriented system through which we perceive the world around us. We naturally see our environment as being composed of things which have recognizable identities & behavior. The entities are then represented as objects in the program. They may represent a person, a place, a bank account, or any item that the program must handle. For example Automobiles are objects as they have size, weight, color etc as attributes (ie data) and starting, pressing the brake, turning the wheel, pressing accelerator pedal etc as operation (that is functions).



Example of objects: 
Physical Objects:
    – Automobiles in traffic flow. simulation
    – Countries in Economic model
    – Air craft in traffic – control system . 
Computer user environment objects:
   Window, menus, icons etc
Data storage constructs. -Stacks, Trees etc 
   –Human entities: -employees, student, teacher etc. 
Geometric objects: -point, line, Triangle etc. 
Objects mainly serve the following purposes:
 Understanding the real world and a practical base for designers
 Decomposition of a problem into objects depends on the nature of problem. 2. Classes A class is a collection of objects of similar type. For example manager, peon, secretary, clerk are member of the class employee and class vehicle includes objects car, bus, etc. It defines a data type, much like a struct in C programming language and built in data type(int char, float etc). It specifies what data and functions will be included in objects of








No comments:

Post a Comment