Computer scienceProgramming languagesKotlinObject-oriented programmingSpecial constructions / Special classes

Object declarations

Cell

Report a typo

You have a class Cell with a nested object BaseProperties. This nested object contains two properties height and width. However, the dimensions of a cell may be different from the default ones, so you need to create its own height and width with the default values from the singleton BaseProperties.

Do not copy and paste values!

Write a program in Kotlin
class Cell {
object BaseProperties {
var width = 10
var height = 10
}
}
___

Create a free account to access the full topic