iOS Swift - Lists and Data Display
What will be the output of this code?
struct Product: Identifiable {
let id: Int
let name: String
}
let p = Product(id: 5, name: "Book")
print(p.id)
id property of type Int and a name property.p.id outputs the integer 5 assigned during initialization.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions