Object-oriented programming (OOPs) concepts in Java
Object-oriented
programming (OOPs) concepts in Java
What
is Java?
Java
is a programming language and It is used for application development.
It was first released in 1995 by Sun Microsystem and later acquired
by Oracle Corporation. It is one of the most commonly used and
popular programming languages.
What
is Java platform?
Java
platform is a collection of programs that help to develop and run
programs in the Java programming language. Java platform includes
execution engine, compiler, and multiple number of libraries. JAVA
is a platform-independent language. It is not specific for any
processor or operating system.
Object-oriented
programming (OOPs) concept in Java
Object-oriented
programming: as the name implies, Object-Oriented Programming or OOPs
refers to languages that use objects in programming. Object-oriented
programming focuses on real-world entities, such as inheritance,
hiding, polymorphism, etc. in programming. The main goal of OOP is
that data and functions that work on them, so no other part of the
code to access this data except this function.
OOPs
Concepts:
• Polymorphism
• Inheritance
• Encapsulation
• Abstraction
• Class
• Object
• Method
Polymorphism:
polymorphism refers to the ability of OOPs programming languages, to
distinguish efficiently between homonymous entities. This is done by
Java with the signature and Declaration of these entities.
Inheritance:
inheritance is an important pillar of OOP (object oriented
programming). It is the mechanism in java that allows a class to
inherit the features(fields and methods) of another class.
Encapsulation:
encapsulation is defined as wrapping of data under a single unit. It
is the mechanism that binds code and data it manipulates.Another way
to think about encapsulation is that it is a shield that prevents the
data from accessing the code outside of that shield.
Abstraction:
data abstraction is the property that allows the user to see only the
essential details.The trivial or non-essential units are not
displayed to the user. Ex: a car is considered to be a car rather
than its individual components.
Class:
A Class is a custom blueprint or prototype from which to create
objects. It represents the set of properties or methods that
are common to all objects of a type.
Object:
it is a basic unit of object-oriented programming and represents the
real-world entities. A typical Java program creates many
objects that are known to interact with call methods.
Method:
a method is a collection of statements that perform a specific task
and return the result to the caller. A method can perform a specific
task without returning anything. Methods allow us to re-use the code
without re-writing the code. In Java, each method must be part of a
class that is different from languages such as C, C++, and Python.
Message
Passing: objects communicate with each other by sending
and receiving information. A message for an object is a request for
execution of a procedure and therefore calls a function in the
receiving object that generates the desired results. When the message
is delivered, the name of the object, the name of the function, and
the information to be sent are specified.
For
more details:
https://www.exltech.in
Comments
Post a Comment