Have a few questions from the test i messed up a bit:
1)
struct FacebookUser {
private var privatePosts: [String]
public var publicPosts: [String]
}
let user = FacebookUser()
I chose true (i thought if we have public var so at least we can make public part), but this is false (This has a private property, so Swift is unable to generate its memberwise initializer for us)
2) Otherwise:
struct Contributor {
private var name = "Anonymous"
}
let paul = Contributor()
I chose false (because have only private part, that didn't want to build in previous example), but this is true
3)
struct School {
var staffNames: [String]
private var studentNames: [String]
init(staff: String...) {
self.staffNames = staff
self.studentNames = [String]()
}
}
let royalHigh = School(staff: "Mrs Hughes")
In this example i chose false, because was afraid of that line with "String...". Could you explain what does it mean "String..."
i just remember we used "..." with range of numbers like 1...10, but this one looks different