“SWIFT -Zugangskontrolle” Code-Antworten

SWIFT -Zugangskontrolle

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

SWIFT -Zugangskontrolle

class Vehicle {

  public func method1() {...}
  private func method2() {...}
}
SAMER SAEID

Ähnliche Antworten wie “SWIFT -Zugangskontrolle”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen