{ "@context": "https://schema.org", "@type": "Organization", "name": "Brainscape", "url": "https://www.brainscape.com/", "logo": "https://www.brainscape.com/pks/images/cms/public-views/shared/Brainscape-logo-c4e172b280b4616f7fda.svg", "sameAs": [ "https://www.facebook.com/Brainscape", "https://x.com/brainscape", "https://www.linkedin.com/company/brainscape", "https://www.instagram.com/brainscape/", "https://www.tiktok.com/@brainscapeu", "https://www.pinterest.com/brainscape/", "https://www.youtube.com/@BrainscapeNY" ], "contactPoint": { "@type": "ContactPoint", "telephone": "(929) 334-4005", "contactType": "customer service", "availableLanguage": ["English"] }, "founder": { "@type": "Person", "name": "Andrew Cohen" }, "description": "Brainscape’s spaced repetition system is proven to DOUBLE learning results! Find, make, and study flashcards online or in our mobile app. Serious learners only.", "address": { "@type": "PostalAddress", "streetAddress": "159 W 25th St, Ste 517", "addressLocality": "New York", "addressRegion": "NY", "postalCode": "10001", "addressCountry": "USA" } }

cs 1.2 (OOP) (ALEVEL) Flashcards

(12 cards)

1
Q

Objects

A

containers of data and instructions(used instead of variables/constants)
new objects created from classes
creating object = instantiation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Class

A

specify what properties (data) and methods (instruction) objects of their type with have

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Private methods/property

A

only accessed from within an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Public methods

A

allow an interface for accessing/modifying a class’ private properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

encapsulation

A

process of combining methods and procedures to form an object, object is said to encapsulate its contents, forming a single entity which encompasses all of object properties/ methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Inheritance

A

A class can inherit another class, inheritance allows one class to share the properties of another class while having its own properties and methods too

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Polymorphism

A

occurs when objects are processed differently depending on their class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Overriding

A

overridden method has the same name as a method in an inherited class but different implementation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

association

A

if two objects associated, they can be described as having a ‘has a’ relationship. e.g. objects of classes Car and Driver can be associated as a car has a driver
The container object holds the associated object as one of its properties (fields)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

aggregation - association

A

when an object is associated with another by aggregation, it will still exist if its containing object is destroyed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

composition - association

A

if two object associated by composition and the containing object is destroyed, associated object is also destroyed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

why use OOP?

A

has a clear structure, makes developing and testing programs easier for developers, allows large projects to be divided among a team, use of classes allows code to be reused throughout program, improves space efficiency of code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly