Oop
Oop
Oriented
Programming
JAVA PRORAMMING
Two approaches to writing computer programs:
Procedural programming
• FORTRAN
• BASIC (Beginners All-purpose Symbolic Instruction Code)
• ALGOL (ALGOrithmic Language
• Pascal
• COBOL (COmmon Business Oriented Language)
• C
Object Oriented Programming (OOP)
• Object-oriented programming is an extension of procedural
programming in which you take a slightly different approach
to writing computer programs.
• Writing object-oriented programs involves creating classes, which
are blueprints for objects.
• The basic unit of OOP is a class, which encapsulates both the static
properties and dynamic operations within a "box", and specifies the
public interface for using these boxes
• OOP combines the data structures and algorithms of a software
entity inside the same box.
Object-oriented programming was used most frequently for two major
types of applications:
• Java • Ruby
• C++ • Perl
• C# • Objective-C
• Python • Dart
• PHP • Swift
• JavaScript • Scala
Class and Objects
A class is the blueprint or template for its objects. Objects are instances
of a class.
Object-oriented terminology
• class is a term that describes a group or collection of objects with
common properties
• class definition describes what attributes its objects will have and what
those objects will be able to do
Polymorphism
I nheritance
E ncapsulation
Encapsulation refers to the hiding of data and methods within an object.
Encapsulation provides the security that keeps data and methods safe
from inadvertent changes.
• Binding the data with methods that will act on that data
Inheritance the ability to create classes that share the attributes and
methods of existing classes