---
# System prepended metadata

title: Sample code

---

# Sample code
## Inner class access
```kotlin=
open class C {

    open fun f() { println("C.f()") }
}

class D : C(){

    override fun f() { println("D.f()") }

    inner class X {

        fun g() {

            //print C.f()
            super@D.f()

            //print D.f()
            this@D.f()
        }
    }
}

fun main(){

    val d = D()

    d.X().g()
}

```
## Secondary constructor example
```kotlin=
class Person(name: String){
    var name=""
    var age=0

    constructor(age :Int,name : String)  : this(name){
        this.age=age
        this.name=name
    }
    fun display(){
        print("Kotlin Secondary constructor $name  , $age")
    }
}
```

## Static function
```kotlin=
class StaticFunctionSample{
    
    companion object{
        
        fun ThisIsStaticFunc(){
            //...
        }
    }
}
```