Last active
June 17, 2020 00:36
-
-
Save sagarpatel288/f3b5957d81bef9c4d3a51fdacfbc2d0d to your computer and use it in GitHub Desktop.
Access java static like variable defined inside of object declaration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 6/16/2020 | |
* Accessing java static like members defined inside of an object declaration | |
* @author srdpatel | |
* @since 1.0 | |
*/ | |
fun main() { | |
//region Accessing members of an object declaration | |
println(StaticInObjectDeclaration.staticExample + " " + StaticInObjectDeclaration.jvmStaticExample) | |
println(StaticInObjectDeclaration.staticMethod() + " " + StaticInObjectDeclaration.jvmStaticMethod()) | |
//endregion | |
} | |
class CallingClass { | |
//region Accessing variables defined inside an object declaration | |
var refStaticInObjDeclaration = StaticInObjectDeclaration.staticExample | |
var refJvmStaticInObjDeclaration = StaticInObjectDeclaration.jvmStaticExample | |
//endregion | |
//region Accessing methods defined inside an object declaration | |
var refStaticMethodInObjDeclaration = StaticInObjectDeclaration.staticMethod() | |
var refJvmStaticMethodInObjDeclaration = StaticInObjectDeclaration.jvmStaticMethod() | |
//endregion | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment