0

Why code isn’t running

class Person { var name = "" var age = 0 init(){ name = Emmanuel age = 26 } } var a = Person() a.name b.age

16th Nov 2022, 3:44 PM
Emmanuel Pena
7 Answers
+ 1
class Person { var name = "" var age = 0 init(){ name = "Emmanuel" age = 26 } } var a = Person() print(a.name, a.age)
16th Nov 2022, 4:02 PM
Solo
Solo - avatar
+ 1
1. Strings must be quoted. Check the value assigned to name. 2. There is no "b" object. Check the last line. 3. Are "a.name" and "b.age" valid swift statements?
18th Nov 2022, 12:30 AM
Emerson Prado
Emerson Prado - avatar
16th Nov 2022, 4:06 PM
Emmanuel Pena
0
Still
16th Nov 2022, 4:12 PM
Emmanuel Pena
0
Take a closer look at the print output.
16th Nov 2022, 7:17 PM
Solo
Solo - avatar
0
I dint get it
16th Nov 2022, 8:22 PM
Emmanuel Pena
0
Thank u !!!
18th Nov 2022, 12:34 AM
Emmanuel Pena