1.2.4e OOP Flashcards
What are objects?
Objects contain methods and attributes, and can link to each other.
What are classes?
Classes act as a template for the code and methods that will be used on an object.
What is a method?
A procedure which defines what an object can/can’t do.
What is an attribute?
Something that an object contains. Related to the behaviour of an object.
What is inheritance?
A new class keeps the same methods and attributes as its parent class, but may also contain unique methods and attributes.
What is polymorphism?
A subclass alters its inherited methods.
What is encapsulation?
Stops data from being overwritten by having private classes which can only be altered via its methods.
What are the advantages and disadvantages of using OOP?
Advantages => High reusability, encapsulation makes programs more robust and reliable.
Disadvantages => Generally unsuitable for smaller programs as classes won’t be reused.