What is the difference between Int and IntCompanion in Kotlin | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the difference between Int and IntCompanion in Kotlin

16th Jun 2019, 3:45 PM
Rishabh patel
Rishabh patel - avatar
3 Answers
+ 3
link code here and I will check it out
19th Jun 2019, 4:38 PM
John Wells
John Wells - avatar
+ 2
There is no IntCompanion in Kotlin that I've seen. Companion objects allow their enclosing class access to static data and methods.
19th Jun 2019, 4:22 PM
John Wells
John Wells - avatar
+ 1
When i try running a program it tells the error found Int in place of Intconpanion
19th Jun 2019, 4:35 PM
Rishabh patel
Rishabh patel - avatar