WEB Button DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

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 Body 

 

we 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() 

 

 

output 

 

You are on the decent Learning site Named-welookups.Academic& 

Nested Class

settled 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" 

Output
 

Welcome to The Welookups.Com 

Anonymous Inner Class

Unknown 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 class
 

a 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() 

Output
 

I am an occurrence of Anonymous Inner Class welookups.Com 

Type Aliases

Type false names is clearly useful for confounded kind

Kotlin 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 accompanying
 

typealias NodeSet = Set<Network.Node> 

typealias FileTable<K> = MutableMap<K, MutableList<File>>