plus you know you are going to pile up memory in the Heap!
v
voddan
07/23/2017, 6:09 PM
No you don't know that. That's the point! Any method you call can allocate a long-living object. Constructors are no special (well, they are special, but in a totally different way)
i
ivano
07/23/2017, 9:45 PM
mmh, I see your point, but I am convinced 95%, take my example please. I am declaring authority, but
DatabaseContract
does not need to be instantiated because is referring to a simple constant, so in a testing situation I do not need to mock authority i guess
said that new in java is used a lot for anonymous classes, and in Kotlin there is no problem because there is the K word