Sha256: a32eec2dca508d9c1c2115cea42f3288adc6eaf616772deca562b06de4d08024

Contents?: true

Size: 1.24 KB

Versions: 90

Compression:

Stored size: 1.24 KB

Contents

/**
 * Simple HelloWorld singleton class as defined by the `Kotlin object keyword`.
 * See: https://kotlinlang.org/docs/reference/object-declarations.html#object-declarations
 *
 * As an alternative one could create a class such as:
 * ```
 * class HelloWorld(name: String? = "Default Value") {
 *     fun hello(): String {
 *
 *     }
 * }
 * ```
 * Resulting in a call such as: `HelloWorld("Bob").hello()`
 * See: https://kotlinlang.org/docs/reference/classes.html#constructors
 *
 * In Kotlin we make objects defined as nullable via the trailing `?`, if you try
 * to assign a null value to any value that isn't nullable a compilation error is thrown.
 * Kotlin makes sure you are accessing nullable values safely and provides null safe calls
 * and the use of the elvis operator. See: https://kotlinlang.org/docs/reference/null-safety.html
 *
 * You may provide default values on methods, so if an argument is omitted the default is used.
 * See: https://kotlinlang.org/docs/reference/functions.html#default-arguments
 *
 * Kotlin provides String interpolation to make String formatting simple.
 * See: https://kotlinlang.org/docs/reference/idioms.html#string-interpolation
 */
object HelloWorld {
    fun hello(name: String? = "Default Argument"): String {

    }
}

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
trackler-2.0.6.34 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.33 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.32 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.31 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.30 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.29 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.28 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.27 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.26 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.25 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.24 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.23 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.22 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.21 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.20 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.19 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.18 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.17 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.16 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt
trackler-2.0.6.15 tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt