Sobes.tech
Junior — Senior

What result will program №10 output

livecode

Task condition

In this example, a class Resolution is declared in Swift with two properties: width and height. An instance hd is created, and then a reference to the same object is assigned to the variable cinema. Next, the width property of the object is changed through the cinema variable. At the end of the program, the value of width of the hd object is printed. Determine what number will be printed.

import UIKit

class Resolution {
    var width = 1920
    var height = 1080
}

var hd = Resolution()
var cinema = hd
cinema.width = 1000

print(hd.width)