Guide for java beginners-Object-oriented programming (OOPs) concept in Java
What
is Java?
Java
is a programming language and a computing platform 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 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 an
execution engine, a compiler, and a number of libraries. JAVA is a
platform-independent language. It is not specific to 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 aims to real-world entities, such as inheritance, to
hide, to implement polymorphism, etc. in the programming. The main
goal of OOP is that data and functions that operate on them, so that
no other part of the code to access this data except this feature.
OOPs
Concepts:
• Polymorphism
• Inheritance
• Encapsulation
• Abstraction
• Class
• Object
• Method
Polymorphism:
polymorphism refers to the ability of OOPs programming languages to
distinguish efficiently between entities of the same name. This is
done by Java using 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 functions(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 that it manipulates.Another
way to think about encapsulation is that it is a shield that prevents
the data from being accessed by the code outside of this shield.
Abstraction:
data abstraction is the property by which only the essential details
are displayed to the user.The trivial or non-essential units are not
displayed to the user. Ex: a car is regarded as 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 by calling 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