Summary Flashcards OOP
Encapsulation is
the process of combining data and methods in single unit
Abstraction
is to hide the complexity of the program , hides the unnecessary details from the user using classes
inheritance
allows creating hierarchy of related classes, allows code reusability
polymorphism
same concept can have different meanings in different contexts has to form overloading and overridding
classes reserves memory?
nope
composition is
make an object
inheritance
extend a class
you can not inherit
final methods/ fields
attribute methods/ fields
private methods/ fields
constructors
constructors and static can not be abstract?
true, as they can not be inherited and for static its for the whole class cannot be overridden
parameters in methods passes by value unless
unless it passes objects or strings
assigning subclass to a superclass can be?
nope , you can’t assign subclass to superclass
a class must have a …
constructor
for each syntax
for (int item:arr) { System.out.println(item); }
arrays holds … (values/references)
references