Tuesday, February 23, 2016

java thory

Java – Theory


What is Java?

Java is a 3rd Generation Object Oriented programming Language, developed by James Gosling in the year 1995. It was initially codenamed as Green and hypothetically called Oak named after the Oak tree outside Gosling’s house.
It is case sensitive and has a unique two step translation process that includes both Compilation and Interpretation which makes Java Platform independent.
What is Procedure Oriented Programming Language?
Pop is a Procedural Oriented Programming Language. In this, the stress is laid on function rather than data. Data may be kept floating throughout the Programming. Hence by scanning the whole program from beginning to the end and we can rectify any error caused. E.g. of POP based language are GW-BASIC, C, etc…
Characteristics of POP
1) Emphasis is laid on functions (Logical steps).
2) Functions share global data.
3) Data values can keep floating from one function to another.
4) Uses top down approach of programming.
Drawbacks of POP
1) As Data values are global to all the functions, you may require making necessary changes in the functions due to change in the data values.
2) It is not suitable to solve complex problems in real situations.
What is Object Oriented Programming Language?
OOP is an Object Oriented Programming Language. It is a modular approach to programming in which equal stress is given to data as well as methods and it allows the data be applied within the stipulated program area. It also provides reusability features to develop productivity logic.
Features of OOP
1. It gives equal stress on data and function.
2. It makes the program simple by dividing it into a number of objects.
3. The objects can be used as a bridge to have data flow from one function to another.
4. Data can be easily modified without any change in the function.
Advantages of OOP
1) We can extend the use of existing class through inheritance.
2) Using the concept data hiding can generate secured program.
3) We can create different modules in our project through objects.
4) Multiple instances of an object can be generated to co-exist without any interference.
5) It is highly beneficial to solve complex problems.
6) It is easy to modified and maintain software complexity.
Examples of OOP based languages are Simula, C++, Java, Python, and Smalltalk etc…
Basic Principles of OOP
1) Encapsulation – Binding up of data members and member functions together into a single unit called (class) is called Encapsulation.
2) Data Abstraction – Act of representing only essential features without including its background details is called Data Abstraction.
3) Polymorphism – The ability of a method to behave in more than one form is called polymorphism. Function Overloading is a way to implement it, in which more than one function has the same name but different argument list.
4) Inheritance – The ability of a class to derive the properties from another class is called Inheritance. The class that inherits is called the Derived / Sub / Daughter class and the class from which it is derived is called Base / Super / Parent class. The keyword used to implement Inheritance is ‘extends’.
5) Object – It is an identifiable entity with some characteristics and behaviour.
6) Class – It is a blueprint that represents a set of objects which share common characteristics and behaviour.
Related Terms 

No comments:

Post a Comment