0% found this document useful (0 votes)
49 views10 pages

ASM

OOP focuses on manipulating objects rather than logic. An object contains attributes like properties and methods like behaviors. A class defines common attributes and methods for similar objects to inherit. Encapsulation hides an object's internal data and only allows access through public methods. Inheritance allows new classes to inherit and extend attributes and methods from parent classes. Polymorphism allows different objects to perform the same method in different ways through method overloading and overriding. Abstraction removes unnecessary complexity and focuses on important aspects. Abstract classes can contain both abstract and regular methods while interfaces only declare methods without implementation.

Uploaded by

Võ Ngọc Hùng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views10 pages

ASM

OOP focuses on manipulating objects rather than logic. An object contains attributes like properties and methods like behaviors. A class defines common attributes and methods for similar objects to inherit. Encapsulation hides an object's internal data and only allows access through public methods. Inheritance allows new classes to inherit and extend attributes and methods from parent classes. Polymorphism allows different objects to perform the same method in different ways through method overloading and overriding. Abstraction removes unnecessary complexity and focuses on important aspects. Abstract classes can contain both abstract and regular methods while interfaces only declare methods without implementation.

Uploaded by

Võ Ngọc Hùng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

ASM Advanced Programming

P1&P2 Examine the characteristics of the object-orientated paradigm as well as the


various class relationships.
OOP
OOP (brief for Object Oriented Programming) – item-orientated programming is a
programming approach primarily based totally at the idea of instructions and items. OOP
makes a speciality of manipulating items instead of the common sense for manipulating
them.
The purpose of OOP is to optimize supply code management, growth reusability, and
maximum importantly, assist encapsulate approaches with acknowledged residences via
the usage of items.
Object (Object)
Objects in OOP include 2 principal components:

Attributes: are the records and traits of the item


Methods: are the behaviors that the item can perform
To make it less complicated to imagine, we've got a real-lifestyles instance of an item that
could be a phone. This item will have:

Attributes: color, memory, working system…


Methods: calling, taking photos, texting, recording...
Class (Class)
Class is an abstraction of the item. Objects with comparable residences are grouped right
into a magnificence. The magnificence may even consist of portions of records:
residences and methods.

An item could be dealt with for instance of the magnificence.

Continuing the instance withinside the item segment above, we've got a phone
magnificence including 2 components:
Attributes: color, memory, working system…
Methods: calling, taking photos, texting, recording...
Objects of this magnificence can be: iPhone, Samsung, Oppo, Huawei...
Encapsulation
Encapsulation permits hiding records and the inner processing homes of the item. Other
items can't immediately have an effect on the facts internal and extrade the kingdom of
the item, however should undergo public strategies supplied via way of means of that
item.

This assets enables to boom the safety of the item and keep away from accidental facts
corruption.
Inheritance
This is a feature that is used quite a lot. Inheritance allows building a new class (Child
class), inheriting and reusing properties and methods based on the old class (Parent class)
that existed before.
Child classes inherit all the members of the Parent class and do not need to be redefined.
Subclasses can extend inherited components or add new ones.
Polymorphism
Polymorphism in OOP programming permits one-of-a-kind gadgets to carry out the
identical feature in one-of-a-kind ways.
Method Overloading : is a manner to overload strategies with the identical call however
special parameters
Method Overriding: This is a technique that overwrites the digital strategies of a sure
superclass (declared with the digital keyword).
To specific this approach want to apply 2 keywords:

virtual : key-word used to claim a digital approach (overridable).


override: key-word used to mark the approach to override the approach of the discern
class.
Abstraction
Abstraction removes the pointless complexity of the item and focuses best on what's
critical and important.
Abstract Class
In summary elegance there are 2 sorts of methods:
summary technique (an empty technique that does nothing)
everyday technique (remains has common sense to go back records or carry out a few
action, it's miles used for widespread purposes)
Interface : Quite just like summary magnificence however interface isn't always
magnificence, in interface handiest announces empty methods/homes with out a
implementation, implementation might be proven in inherited classes, interface is sort of
a template framework to implementation and comply with classes.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy