Skip to content

Instantly share code, notes, and snippets.

View saturov's full-sized avatar

Eugene Saturov saturov

View GitHub Profile
open class Base {
open fun v() {}
fun nv() {}
}
class Derived() : Base() {
override fun v() {}
}
class MyView : View {
constructor(ctx: Context) : super(ctx) {
}
constructor(ctx: Context, attrs: AttributeSet) : super(ctx, attrs) {
}
}
open class Base(p: Int)
class Derived(p: Int) : Base(p)
class Example // неявно унаследован от класса Any
val invoice = Invoice()
val customer = Customer("Joe Smith")
class Customer(val customerName: String = "")
class DontCreateMe private constructor() {
}
class Person(val name: String) {
constructor(name: String, parent: Person) : this(name) {
parent.children.add(this)
}
}
class Person {
constructor(parent: Person) {
parent.children.add(this)
}
}
class Customer public @Inject constructor(name: String) {
// ...
}