NAME: ________________________
← Object-oriented programming Test
5 Written Questions
5 Multiple Choice Questions
- Object contains both: data stored in properties
Means to do something w the data (using methods) - designer, project manager & programmer are all based on and extend a person object
- Bob holds data (e.g. birth date) and methods that work with the data (e.g. calculate age)
- you can call methods Bob:talk, Jill:talk & Jack:talk and all will work fine producing different results. each "object" inherited the "method" talk from Person and customized it
- Bob's date of birth is June 1st, 1980, gender: male, hair: black
5 True/False Questions
-
objects → Bob can eat sleep drink dream talk calculate his age
-
OBJECTS → Bob can eat sleep drink dream talk calculate his age
-
methods → Class = blueprint, recipe
note: no classes in js, everything is based on objects, it is prototypal OO language -
information hiding → reuse code already written. in javascript objects inherit from other objects, usually adds new methods (verb) to inherited ones — "extending" the old object "B inherits from A" & "B extends A"
note: object that inherits methods can pick one or more and redefine them, customizing or "overriding" -
INHERITANCE → Bob's date of birth is June 1st, 1980, gender: male, hair: black
Regenerate Test