Type Properties | SoloLearn: Learn to code for FREE!


Type Properties

In the block of code below, is computedProp a variable? How is computedProp different from an int function that simply returns value 4? class SomeClass { static var storedProp = "Some value." static var computedProp: Int { return 42 } } print(SomeClass.storedProp) print(SomeClass.computedProp)

4/13/2020 7:54:14 AM

Daniyal Dianati

1 Answer

New Answer


Which language it is?