In my recent posts about using or omitting a "new" keyword in Scala ( "new" keyword in Scala) I was told that the omission comes from the fact that certain classes have companion objects defined with apply method on them. My question is: are we able to tell or is there any general rule to distinguish which classes/objects have a companion object and apply method?
Thanks in advance and sorry of it's a stupid question, but coming from a Java background it is a bit confusing.