Skip to content

Example

This class is an example to see how the documentation website is generated.

Example

Example().foo("Hello") shouldBe "Hello world!"

Another example:

class Foo {
    public static void main(String[] args) {
        System.out.println("Hello world!" + 3 + true);
    }
}

Constructors

Example

constructor()

Public constructor for the Example class.

constructor(s: String)

Secondary constructor.

Parameters

  • s: Some variable.

Example

fun Example(id: Int): Example

Top-level function masquerading as a constructor.

Types

Companion

object Companion

The companion object.

Nested

class Nested

Properties

counter

var counter: Int

A value that increments by one each time it is accessed.

This builder is not thread-safe.

prop2

Extension property for ExampleAlias.

prop3

Extension property for ExampleAlias.

Functions

foo

fun foo(bar: String): Boolean

This is an example function.

This is a reference to a parameter: bar.

Return

This is a return type.

Parameters

  • bar: This is a parameter.
fun foo(number: Int): Boolean

Some other documentation.

See also

foo2

inline suspend fun <T> ExampleAlias.foo2(): T

Extension function for ExampleAlias.

foo3

inline suspend fun <T> ExampleAlias.foo3(): T

Extension function for ExampleAlias.

fromInterface1

open fun fromInterface1(): String

This is a method from the interface MyInterface.

It is not overridden by the class Example.

fromInterface2

open override fun fromInterface2(): String

This is a method from MyInterface that has been overridden by the Example class.