Tam H. Doan
1 min readFeb 13, 2020

--

Hi, thanks for reading.

You can alsocreate a utils class with a companion object too. Because it's just a normal object that tied to your outer class.

The difference is when you use companion object and call your util method in Java code, you need to add Companion instead of INSTANCE (which I have mentioned in the article).

--

--

Tam H. Doan
Tam H. Doan

Written by Tam H. Doan

Software Engineer, also a Writer and Runner

No responses yet