Unit 5: Writing Classes

Cards (16)

  • public: Allows access to data and methods from classes outside the declaring class.
  • private: Restricts access to data and methods to the declaring class.
  • Encapsulation: The process of hiding the implementation details of a class from the user
  • Accessor Methods: Methods used to access instance variable and object data. Also referred to as getter methods.
  • Mutator Methods: Methods used to change or manipulate instance variable or object data. Also referred to as setter methods.
  • alias: A variable that references an existing object. When the alias variable is manipulated, so is the original object, and vice versa.
  • Preconditions: Conditions that must be true prior to execution in order for that code segment to behave as expected.
  • Postconditions: Conditions that must be true after the code segment is executed.
  • Static Variables: Variables that can be accessed by all objects of a class. They are called using the class name, and can be used in static and non-static methods.
  • Static Methods: Methods that can be used directly by the class name. They cannot access instance variables or non-static methods.
  • Method Decomposition: The process of breaking down large problems into smaller problems, each with a method that defines a subproblem in the larger problem.
  • Shadowing: If two variables within the same scope have the same name, the variable with the more specific scope will be called.
  • Local Variable: A variable that is defined in a method or constructor. It only exists in the context of the method that it belongs to.
  • this Keyword: Makes a call to the current object in a class file. Allows programmers to specify which objects and instance variables should be called.
  • Association for Computing Machinery: organization for computing professionals to provide guidance related to ethics and responsibilities.
  • Bias: Prejudice in favor of or against one thing, person, or group compared with another, usually in a way considered to be unfair.