Friday, 16 January 2015

Features of java


what is the difference between Procedural and OOPs?
Procedural
->programming logic follows certain procedures and the instructions are executed one after another
-> data is exposed to the whole program
Oops
-> unit of program is object, which is nothing but combination of data and code

Features of Java
The basic features of Java are given below :
• Java is simple.
• Java provides immense security.
• Java provides high portability.
• Java provides object oriented programming features
• Java provides robustness.
• Java is multithreaded.
• Java provides architecture neutrality.
• Java is distributed
• Java is dynamic

How java becomes object oriented?

• Java follows the paradigm of OO programming.
• Java follows modular approach.
• Java follows the abstraction aspect.
• Java follows the OO principle encapsultaion.
• Java follows the OO principle polymorphism.
• Java follows the OO principle inheritance.


Some of the explanations why java features are important
1.Simple:-
Java is a simple programming language.Because of 2 reasons.
1)Java Soft people maintained the same syntax of C and C++ in  Java.
2)Pointers are eliminated in Java.
II.  Why pointers are eliminated from Java?
1)Pointers can crash program very easily.
2)Using pointers,it is possible to develop harmful programs like virus and hacking programs. So Pointers are security threat for java.   Because of these reasons pointers are eliminated from java.

2) Object-Oriented:-
Java programs use Objects and classes.
    Object:- An object is anything that exists physically in this   world.
              An object will have properties(variables) and actions(methods).
    variable:- It represents memory location to store data.
     
     Class:- It is a group name that specifies properties and actions  of objects.
        ==> class also contains variables and methods.
==> Class is only specification but object exist physically.
==> Class is a model for creating Objects.

3) Distributed:-
Information is distributed on various computers on a network.
Using java,we can write programs which capture information and           distribute it to the clients.

4) Robust:-
      Robust means strong.Java programs are strong and they don't crash easily like c and C++.
There are 2 reasons for this.
1)Java has got excelent exception handling features.
2)Memory management features.
         Here memory allocation is done by JVM's Class loader subsystem.
      Memory deallocation is done by JVM's garbage collector.

5) Secure:-
Security problems are eleminated by using java on Internet.

Encapsulation:
-> that binds together code and data it manipulates and keeps both safe from outside interference and misuse.
Inheritance
-> is the process by which one object acquires the properties of another object.
Advantages:
1 reusability of code and
2    accessibility of variables and methods of the super class by subclasses.
Polymorphism
->Polymorphism is the feature that allows one interface to be used for general class actions.
A class can have only public or default(no modifier) access specifier.
It can be either abstract, final or concrete (normal class)
Each .java  source file may contain only one public class. A source file may contain any number of default visible classes.

No comments:

Post a Comment