concept class in category kotlin

This is an excerpt from Manning's book The Joy of Kotlin.
Tests are created in the same place as standard JUnit tests: in the src/test/kotlin directory of each subproject. If you’re using IntelliJ, click the function to test, type Alt+Enter, and select Create Test. In the dialog box, select a version of JUnit. IntelliJ will complain that this version is absent and will propose to fix this. Ignore this error and check that the destination package is in the correct branch (
javaorkotlin, in case of a mixed project). Change the proposed name for the class if you want, but don’t select any function to test, and then click OK. IntelliJ creates an empty file in the correct package.
A Kotlin class is public by default, so there’s no need for the word public. To make a class non-public, you can use the private,protected, orinternalmodifiers. Theinternalmodifier means that the class is accessible only from inside the module where it’s defined. There’s no Kotlin equivalent for "package private" (corresponding to the absence of a modifier) in Java. Unlike Java,protectedis restricted to extending classes and doesn’t include classes in the same package.A Kotlin class is final by default, so the equivalent Java class would be declared with the finalmodifier. In Java, most classes should be declaredfinalbut programmers often forget to do that. Kotlin solves this problem by making classesfinalby default. To make a Kotlin class non-final, use theopenmodifier. This is much safer because classes opened for extension should be specifically designed for this.
Extending a class uses the same syntax. The difference is that the extended class name is followed by the parameter names enclosed in parentheses:
class Member(name: String, registered: Instant) : Person(name, registered)Remember, however, that classes are final by default. For this example to compile, the extended class must be declared
open, which means open for extension:open class Person(val name: String, val registered: Instant)