Florian
10/04/2019, 2:57 PMLuke
10/04/2019, 3:07 PMcom.example.myvariables
, you can either import com.example.myvariables.someVariable as anotherName
and use anotherName
instead, or you can import com.example.myvariables
and call myvariables.someVariable
(that one won’t work if you are in the same package), or you can call directly com.example.myvariables.someVariable
alex
10/04/2019, 3:10 PMFlorian
10/04/2019, 3:14 PMalex
10/04/2019, 3:17 PMimport <very long name> as <short name>
Florian
10/04/2019, 4:38 PMthis
in classes?Florian
10/05/2019, 7:35 PMFlorian
10/05/2019, 7:36 PMalex
10/07/2019, 3:13 PMpackage test.a
val a = 1
class Test(val a: String) { fun test() { println(test.a.a) } }
fun main() {
val test = Test("a")
test.test()
}
>> 1
Something like this.