Kotlin companion object - common use cases

Published: 07 March 2021
on channel: Rahul Pandey
9,345
299

The companion object allows you to have properties or functions without having an instance of the class. There are no static variables in Kotlin, so this is how you achieve the same thing.

➤ Programming Kotlin by Venkat Subramaniam: https://amzn.to/33yHJ7r
➤ Android Cookbook: https://amzn.to/3IfEX6h
➤ Head First Kotlin: https://amzn.to/3I77Z7Z

https://discuss.kotlinlang.org/t/what...

Hi! I’m Rahul, a software engineer with a passion for teaching. I went to Stanford, was a founding engineer at a startup, and have worked at various companies across Silicon Valley. I’m currently an Android Developer at Facebook and teach an Android class at Stanford. Would love to connect with you! This channel is about tech (especially Silicon Valley), combining tactical how-to guides with interviews.

📹 YouTube: https://www.youtube.com/c/RahulPandey...
📝 LinkedIn:   / rpandey1234  
🐦 Twitter:   / rpandey1234  
📸 Instagram:   / rpandey1234  
📂 Github: https://github.com/rpandey1234/


Watch video Kotlin companion object - common use cases online without registration, duration hours minute second in high quality. This video was added by user Rahul Pandey 07 March 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 9,345 once and liked it 299 people.