Lecture 6: Objects and Classes

This lecture explores Kotlin's concise syntax for class definitions, comparing it with that of Java. It considers how properties are used to provide access to the underlying fields in a class. It looks at object initialisation using primary & secondary constructors and init blocks. It also looks at how custom getters and setters can be written for properties. Finally, it considers the role played by the object keyword in defining instances of anonymous classes, creating singletons and simulating the effects of Java's static keyword.