diff options
Diffstat (limited to 'sem5/oop/m1/notes.md')
-rw-r--r-- | sem5/oop/m1/notes.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sem5/oop/m1/notes.md b/sem5/oop/m1/notes.md new file mode 100644 index 0000000..e879057 --- /dev/null +++ b/sem5/oop/m1/notes.md @@ -0,0 +1,29 @@ +# Introduction + +## Interfaces + +Abstract class used to define object API. + +Classes can then implement this API. + +``` +public interface Car { + public void turn(blabla); + blabla; +} +``` + +### Polymorphism + +Most general interface is Object (like golangs interface{} ? ). + +## Encapsulations + +Hide internal details. +This can be done with getters and setters. + +These getters and setters can then be used to to input validation. + +## Private vs protected + +Protected are accessible to subclasses which inherit from it. |