Kotlin is object oriented language?

All QuestionsCategory: KotlinKotlin is object oriented language?
chetan shidling asked 2 weeks ago

I need short information.

1 Answers
chetan shidling answered 2 weeks 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()
}
Your Answer