OOP Concepts in Java
Java is a multi-paradigm programming language. Means, it supports different programming styles.
One of the popular ways to solve a programming problem is by creating objects, known as object-oriented style of programming.
Java supports object-oriented (OO) style of programming.
As the name object-oriented programming suggests, this approach deals with objects.
In object-oriented programming language, the data and methods are bundled together as self-contained unit called an object.
A class is an extended concept similar to the structure in C programming language. In Java programming language, class describes both the properties (data) and behaviors (methods) of objects.
In this chapter, we will learn about basics of OOPs. Object Oriented Programming is a paradigm ( style, pattern ) that provides many concepts such as inheritance, encapsulation, polymorphism etc.
The key ideas of OOP approach are :
The key concepts of OOP approach are :
Any entity that has state and behavior is known as an object. For example: keyboard,laptop, bike etc. It can be physical and logical.
Collection of objects is called class. It is a logical entity.
Encapsulation is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse. One way to think about encapsulation is as a protective wrapper that prevents the code and data from being arbitrarily accessed by other code defined outside the wrapper/class.
Inheritance is the process by which one object acquires the properties of another object. This is important because it supports the concept of hierarchical classification. Without the use of hierarchies, each object would need to define all of its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent.
Polymorphism (from the Greek, meaning "many forms") is a feature that allows one interface to be used for a general class of actions. The specific action is determined by the exact nature of the situation. Polymorphism is a way by which an object can exhibit multiple behaviour in multiple instances or situations.
Training For College Campus
We offers college campus training for all streams like CS, IT, ECE, Mechanical, Civil etc. on different technologies
C, C++, Data Structure, Core Java, Advance Java, Struts Framework, Hibernate, Python, Android, Big-Data, Ebedded & Robotics etc.
Please mail your requirement at email@example.com
Projects For Students
Students can contact us for their projects on different technologies Core Java, Advance Java, Android etc.
Students can mail requirement at firstname.lastname@example.org