OOP Flashcards
what is oop
= a programming methodology centered around the concepts of classes and objts
used to transfer a model of the rw > sw.
Why? to simplify dev and maintainance.
eg: pet main system for dogs.
what is design process?
what is a class
a class is a blueprint from which individual objts are created.
what is a object
any thing that has a state and behavior.
eg-car
state(attritubutes)
-make, model, size
behavior
- move, reverse, turn
what are advantages of oop over procedure
dev and maint easier. > as complexity increases
hides data whereas procedural allows global.
what is a constructor
a code block similar to a method.
used to initialized the object.
when is a constructor called
when an object is created. it constructs the value at that time.
what are the rules for creating a constructor
3 name = class name no explicit return type cant be FASS final, abstract, synchronized, static
what are the types of constructors
2
default = compiler creates w/o parameter
parameterized = has parameter when created
constructor overloading
a technique of having more than 1 constructor w/ diff parameter lists.
arranged in a way the each constructor performs diff task.
what are differences btwn constructors and methods
c (5) used to initialize state of objt must not have return type invoked implicitly provided by compiler name must be same as class
m expose behavior of objt must have return type invoke explicitly not provided by compiler name may or may not be same as class
= a methodology to design a program using classes and objts.
it simplifies sw dev + maintainance via core concpets of oc pai en
oop
is a blueprint from which individual objts are created.
class
any thing that has a state and behavior.
objt
dev and maint easier. > as complexity increases
hides data whereas procedural allows global.
what are advantages of oop over procedural
a code block similar to a method.
used to initialized the object.
constructor