Szybka kontrola dostępu
class Student {
// private property
private var name = "Tim Cook"
// private method
private func display() {
print("Hello from Student class")
}
}
// create object of Student class
var student1 = Student()
// access name property
print("Name:", student1.name)
// access display() method
student1.display()
SAMER SAEID