Swift Day 21 – Inheritance
Swift Day 21 Challenge
- Create a base class called Player that is a player in your game with the variables – name, age, playerNo
- Create a function in this that describes the player
- Create a class Player1 that inherits from Player.
- Change the values in Player1 and then print them with the base class function
- Create one more Class called PlayerWithForcedValues
- Make this class force you to write all the values into the class when you initialize it
Like and Subscribe for more videos
#Swiftprogramming, #100daysofswift, swift#tutorials, #swiftlang
Please like and subscribe the video. 🙂