Save
A-level Computer Science
School Notes
OOP
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Ana Saker
Visit profile
Cards (23)
What does Object Oriented Programming (OOP) focus on?
Classes
and
objects
View source
What is a class in OOP?
A
template
for a
set
of
objects
View source
What do objects in OOP have?
State
and
behaviour
View source
What is an object in OOP?
An instance of a
class
View source
What does an object hold?
Attributes
and
methods
View source
What is an attribute in OOP?
A
variable
attached to a
class
View source
What is a method in OOP?
A piece of code that performs an
action
View source
Which method would you use to get an object's name?
getName()
View source
What does inheritance allow in OOP?
A
derived class
inherits attributes from
superclass
View source
What is a derived class?
A class that inherits from a
superclass
View source
What does a derived class have in addition to inherited attributes?
Its own attributes and
methods
View source
What does the constructor method do?
Creates a new
object
and sets attributes
View source
How do you create a new Monster object?
monsterOne = new Monster(true, 5, "
Boris
")
View source
What does the method monsterOne.eat() output?
Boris
eats a hero.
View source
What is polymorphism in OOP?
Same
method
behaves differently in classes
View source
What is encapsulation in OOP?
Data hiding and access through
methods
View source
What is a benefit of encapsulation?
Reduces
errors
and maintains
data integrity
View source
How does OOP differ from procedural programming?
OOP defines
objects
as independent entities
View source
How can OOP improve code maintenance?
Classes
can be modified or extended easily
View source
What is a key advantage of using OOP for queues?
Multiple
instances
can be created easily
View source
Why is OOP considered more secure than procedural programming?
Access to
attributes
can be restricted
View source
What are the advantages of using an object-oriented paradigm?
Code can easily be reused
Classes can be used in other programs
Inheritance
extends existing
classes
Easier to maintain and modify classes
Debugging is simplified through
encapsulation
Code security is enhanced by restricting access
Better for team collaboration with distributed classes
View source
Compare procedural programming and OOP for implementing a queue.
Knowledge:
OOP defines
objects
as independent entities
Attributes
can be
private
to restrict changes
Application:
OOP allows object creation from the queue
Procedural requires individual queue declarations
Evaluation:
OOP reduces
code
redundancy and
errors
Procedural needs careful value passing and global variables
View source