This question was asked by an interviewer recently. I replied that companion object is class level singleton and thus can’t have multiple companions. He further asked that we If we have to create singleton class then we can use ‘object’ keyword to create singleton class. In which situation you should choose companion object over object keyword. This was confusing to me and i couldn’t satisfy the interviewer. So, in which situation it is best to use companion object over object keyword.
I was not able to find any reliable answer on stack overflow.