Kotlin is object oriented language?


Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8
All QuestionsCategory: KotlinKotlin is object oriented language?
chetan shidling asked 5 years ago

I need short information.

1 Answers
chetan shidling answered 5 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()
}