Add the rest of university notes

This commit is contained in:
John Gatward committed 2026-10-04 14:02:35 +01:00
1 parent c1b84c7f7d
commit d0f27f276b
366 files changed
+9844 -110

No files matched your search

+3 -3
View File
@@ -91,7 +91,7 @@ public class Compound {
}
```
![Image](/lectures/dms/assets/1.png)
![Image](assets/1.png)
*Composition* - The object only exists if the parent object exists, if the parent object is deleted then so is the child object.
The zoo object owns the compound object. If the zoo object is deleted then the compound object is also deleted.
@@ -102,7 +102,7 @@ public class Zoo {
}
```
![Image](/lectures/dms/assets/2.png)
![Image](assets/2.png)
**Inheritance**
A way of forming new classes based on existing classes. Has a "is-a" relationship.
@@ -126,7 +126,7 @@ public class Child extends Parent {
The super keyword called the parent class' constructor.
![Image](/lectures/dms/assets/3.png)
![Image](assets/3.png)
**What is the difference between an abstract class and an interface**
- Java abstract class can have instance methods that implement a default behaviour. May contain non-final variables.