Comp Sci Finals

Description

compsci
UdaraJay
Flashcards by UdaraJay, updated more than 1 year ago
UdaraJay
Created by UdaraJay almost 9 years ago
5
0

Resource summary

Question Answer
Class Describes objects with the same behaviour
Object oriented programming Where tasks are solved by collaborating objects
Hashable Means that the could be equated in a
Immutable An object whose state cannot be modified once it's created. trupuls are immutable eg. Opposite = mutable.
Hashable Objects which are considered washable should be equal in the sense that they have the same hash value.
Public interface of a class The set of all methods provided by a class along with their description
Encapsulation When the implementation details of a public class are hidden. This is usually done for programs which are being developed over a long period of time and you don't necessarily care about how each method is implemented - and encapsulation is used to make the object more capable USERS DON'T get direct access to any of the instance variables.
Accessor methods are getters
Mutator methods are setters
Instance variables Objects store their data in instance variables. An instance of the class is an object of that class. Instance variables are part of the implementation that should be hidden from the user. Although python does not enforces this the underscore before the variable indicates that it should not be directly accessed.
Unit testing this is the process of testing in isolation - outside the complete program
Method headers method headers and method comments are used to specify the public interface of a class.
Mutator method changes the object on which it operates - can be a accessor (getter - does not change the object it operate on) or a mutator (setter)
Data representation for each accessor method the the object must either store or compute the results.
Constructor initializes the objects instance variables - invoked when an object is created, uses the special method __init__(). self. is used to access the instance variables
Object tracing used to visualize object behaviour.
Special method to use a standard method with an object, define that special method. __repr__() is used to create the sting representation of an object
Throw early when a method detects a problem it is better to throw an error early than trying to make an imperfect fix.
Try, except and finally are the main ways to handle errors. -
Exceptions All errors finally lead unto an exceptions, exceptions can be split to: Warning & Standard Errors
Show full summary Hide full summary

Similar

110 Revision
Luke Ericcson
Java
Lulu__
Transition Metals
Madeleine.Dc
P2a revision (part 1)
juliasutton
GCSE Geography Climate Change
EllieFlint
River Landscapes
Chima Power
OCR Gateway Biology Flash Cards
Sam Newey
AS Economics Key Terms
Fred Clayton
Strength and Limitations of research methods
Isobel Wagner
GCSE geography natural environment
Archie Horwood
Aggregate Supply, Macroeconomic Equilibrium, The Economic Cycle, Economic Growth, Circular Flow and Measuring National Income
Hannah Nad