2. OOPS
Object-oriented programming (OOP) is a computer programming model that
organizes software design around data, or objects, rather than functions and logic.
An object can be defined as a data field that has unique attributes and behavior.
OOP can be used for manufacturing system simulation software.
3. OOPS
What are the main principles of OOP?
Encapsulation
Abstraction
Inheritance
Polymorphism
4. OOPS
Encapsulation : This principle states that all important information is contained
inside an object and only select information is exposed
Abstraction : Objects only reveal internal mechanisms that are relevant for the
use of other objects, hiding any unnecessary implementation code.
Inheritance : Classes can reuse code from other classes. Relationships and
subclasses between objects can be assigned, enabling developers to reuse
common logic while still maintaining a unique hierarchy
Polymorphism: Objects are designed to share behaviors and they can take on
more than one form. The program will determine which meaning or usage is
necessary for each execution of that object from a parent class, reducing the
need to duplicate code.
5. Class
In object-oriented programming, a class is a blueprint for creating objects (a
particular data structure), providing initial values for state (member variables or
attributes), and implementations of behavior (member functions or methods).
A class is a group of objects which have common properties.
It is a blueprint or prototype for creating objects.
Class members are access modifiers.
7. Object
An object is an instance of a class.
Any entity that has state and behavior
is known as object.
For example a chair,pen.
8. Access Modifier
An access modifier is a keyword in object-oriented programming languages like
Java that defines the scope and visibility of classes, methods, fields, and
constructors within a program.
Public Access Modifier
We can access the public modifier from anywhere. We can access public modifiers
from within the class as well as from outside the class and also within the package
and outside the package.
9. Access Modifier
Private Access Modifier
We can access the private modifier only within the same class and not from outside
the class.
Default Access Modifier
We can access the default modifier only within the same package and not from
outside the package. And also, if we do not specify any access modifier it will
automatically consider it as default.
10. Access Modifier
Protected Access Modifier
We can access the protected modifier within the same package and also from
outside the package with the help of the child class. If we do not make the child class,
we cannot access it from outside the package. So inheritance is a must for accessing
it from outside the package.