Confluence docs. Initial version

This commit is contained in:
Andrey Breslav
2012-05-30 14:41:14 +04:00
parent d7573b49a6
commit 69e74cb147
50 changed files with 5716 additions and 0 deletions
@@ -0,0 +1,34 @@
Classes can be nested in other classes:
{jet}
class Outer() {
private val bar : Int = 1
class Nested() {
fun foo() = 2
}
}
val demo = Outer.Inner().foo() // == 2
{jet}
h3. Inner classes
A class may be marked as *inner* to be able to access members of outer class. Inner classes carry a reference to an object of an outer class:
{jet}
class Outer() {
private val bar : Int = 1
inner class Inner() {
fun foo() = bar
}
}
val demo = Outer().Inner().foo() // == 1
{jet}
See [Qualified *this* expressions|This expressions#Qualified] to learn about disambiguation of *this* in inner classes.
{note:title=Inner classes are under development}See the corresponding [issue|http://youtrack.jetbrains.com/issue/KT-1174].{note}
h3. What's next
* [Object expressions and Declarations]