This OOP concept involves focusing on essential features while removing unnecessary details.
What is Abstraction?
The visual modeling language used to represent class relationships, attributes, and methods.
What is UML (Unified Modeling Language)?
This type of variable belongs to the class itself rather than any specific instance.
What is a Static (or Class) variable?
The process of "wrapping" data and the methods that work on that data into a single unit.
What is Encapsulation?
The special method called automatically when a new object is created.
What is a Constructor (or __init__ in Python)?
The specific "blueprint" or template used to define the data and behavior of a real-world entity in code.
What is a Class?
In a UML diagram, this symbol is placed before an attribute name to indicate it is private.
What is the minus sign (-)?
These variables are unique to each object and define its individual state.
What are Instance (or Non-static) variables?
In Python, you suggest a variable is private by starting its name with this character.
What is an underscore (_)?
The error: my_car = Car.
What is the object was not instantiated (it refers to the class, not a new instance, because it lacks parenthesis).
An individual instance of a class that contains its own unique data.
What is an Object?
In a UML diagram, this symbol indicates a public method or attribute.
What is the plus sign (+)?
Use this type of function when you need a function that performs a task related to the class but doesn't need to access individual object data.
What is a Static method/function?
In Python, you make a variable is name mangled by starting its name with this character.
What is a double underscore (__)?
The term for setting the initial values for an object’s attributes at the time of creation.
What is Initialization?
This paradigm allows for better Modularity, where complex systems are broken into smaller, manageable parts.
What is Object-Oriented Programming (OOP)?
A reason a developer would create a UML diagram before writing any code.
What is to plan effective software design and illustrate functional requirements (or internal structures)?
A difference between the scope of a static variable and an non-static variable.
What is a static variable being shared by all instances (objects) while non-static variables are unique to each object?
The reason limiting access to an objects variables is important.
What is maintaining the integrity and security of the object's state (preventing illegal values)?
The header for a class named Player in Python.
What is class Player:?
one disadvantage of OOP compared to procedural programming in a small, simple script.
What is increased complexity or overhead (or slower execution for very simple tasks)?
The line of code that would be used to initialize the public variable color in the constructor for a Car object.
What is self.color = color?
In Python, this keyword is used as the first parameter in an instance function to refer to the specific object being called.
What is 'self'?
These types of public functions are used to safely "get" or "set" the values of private attributes.
What are Accessor (Getter) and Mutator (Setter) methods?
The code to instantiate an object named p1 from a class named Player.
What is p1 = Player()?