Home / Report Question

Q. Which of the following is a correct way to declare a computed read-only property?
  • A. var square = side * side
  • B. var square: Int { return side * side }
  • C. let square = side * side
  • D. var square() -> Int