CS Electrical And Electronics
@cselectricalandelectronics

Kotlin is object oriented language?

All QuestionsCategory: KotlinKotlin is object oriented language?
chetan shidling asked 4 years ago

I need short information.

1 Answers
chetan shidling answered 4 years ago

Yes, Kotlin is an object-oriented language.

Example:

class myClass {
   // property (data member)
   private var name: String = "CS Electrical And Electronics"
   
   // member function
   fun printMe() {
      print("You are at the Number 01 Learning website Named-"+name)
   }
}
fun main(args: Array<String>) {
   val obj = myClass() // create obj object of myClass class
   obj.printMe()
}