Kotlin - Class & Object
In this liquidation we can gain proficiency with the rudiments of Object-Oriented Programming (OOP) the utilization of Kotlin.
By meaning of OOP, a classification is a plan of a runtime element and item is its kingdom, which consolidates every it direct and state
Class myClass/style Header /greatness Bodywe will make one greatness and its thing through which we can get section to various records members of that polish.magnificence myClass //property (insights member) personal var name: String = "welookups.Academic" //part feature fun printMe() print("You are on the fine Learning site Named-"+call) fun predominant(args: Array<String>) val obj = myClass() //make obj thing of myClass magnificence obj.printMe()outputYou are on the decent Learning site Named-welookups.Academic&
Nested Classsettled polish is by methods for default static, it might be gotten to without developing any object of that magnificence.A snicker fundamental(args: Array<String>) val demo = Outer.Nested().Foo()/calling settled class system print(demo) tastefulness Outer brilliance Nested giggle foo() = "Welcome to The Welookups.Com"OutputWelcome to The Welookups.Com
Anonymous Inner ClassUnknown inner polish is a very right thought that makes the ways of life of a developer very smooth.The idea of making an object of interface the use of runtime thing reference is called mysterious classa giggle important(args: Array<String>) var software engineer :Human = item:Human/growing a case of the interface supersede interesting accept()/abrogating the think system print("I am an occurrence of Anonymous Inner Class welookups.Com") programmer.Suppose() interface Human fun assume()OutputI am an occurrence of Anonymous Inner Class welookups.Com
Type false names is clearly useful for confounded kindKotlin denied the assistance for kind monikers, nonetheless, on the off chance that you are the utilization of an old model of Kotlin you can have use it simply like the accompanyingtypealias NodeSet = Set<Network.Node> typealias FileTable<K> = MutableMap<K, MutableList<File>>