CSC 1 Flashcards
CSC 1 Flashcards
Q: What is a class?
A: A blueprint for creating objects, containing attributes (variables) and methods (functions).
Q: What is an object?
A: An instance of a specific class defined by its attributes and methods.
Principles of OOP
Q: What is encapsulation?
A: Keeping an object’s state private, accessible only via public methods, so other classes
can’t directly change its state.
Q: What is abstraction?
A: Reducing complexity by hiding internal implementation details and showing only the
essential functionalities.
Q: What is inheritance?
A: A child class derives from a parent class, reusing its methods and fields while adding its
own unique elements.
Q: What is polymorphism?
A: The ability to use a class like its parent, while each child class keeps its own unique
implementation of methods.
Data Storage
Q: What is a variable?
A: A named storage for data that can be retrieved later.
Q: What is an array?
A: A container for storing multiple data items in fixed, zero-indexed buckets.
Functions
Q: What is a function?
A: A named series of instructions focused on a specific task, reusable and callable by
name.
Debugging
Q: How can you debug your code?
A: