Answers for "protocol oriented programming swift github Basic"

0

protocol oriented programming swift github Basic

protocol FullName {
    var firstName: String {get set}
    var lastName: String {get set}
    
    func getFullName() -> String
}

protocol Person: FullName {
    var age: Int {get set}
}

struct Student: Person {
    var firstName = ""
    var lastName = ""
    var age = 0
    
    func getFullName() -> String {
        return "(firstName) (lastName)"
    }
}
Posted by: Guest on May-19-2021

Code answers related to "protocol oriented programming swift github Basic"

Code answers related to "Swift"

Browse Popular Code Answers by Language