repl.it
@adityakin/

PoliteImaginativeLicense

Kotlin (beta)

No description

fork
loading
main.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Class myClass { // class Header 

   // class Body
}


we will create one class and its object through which we will access different data members of that class.

class myClass {
   // property (data member)
   private var name: String = "welookups.tutorial"
   
   // member function
   fun printMe() {
      print("You are at the best Learning website Named-"+name)
   }
}
fun main(args: Array<String>) {
   val obj = myClass() // create obj object of myClass class
   obj.printMe()
}
Welcome to Kotlin version 1.0.3
?