// Difference between method overriding vs method overloading class iPhone { var name: String { return "My phone is Apple brand. The name of the phone is iPhone 16." } } class Android: iPhone { override var name: String { return "My phone is Android brand. The name of the phone is Xiaomi 11(mi)." } } var obj = Android() print(obj.name) ---------> Method overriding vs Method overloading <----------- - Difference between method overriding vs method overloading - Method Overloading: 1) Parameter must be different. 2) It occurs within the same class. 3) Inheritance is not involved. 4) Return type may or may not be same. 5) One method does not hide another. Method Overriding: 1) Parameter must be different. 2) It occurs between two classes - sub class and a super class. 3) Inheritance is involved. 4) Return type must be same. 5) child method hides parent another. class Vehicle { func displayInfo(){ ... } } class Car: Vehicle { // override method override func displayInfo() { ... } }