+ 1
What are temporary inntances? What is their use in java?
3 Antworten
+ 4
@Suhail, I never heard of anonymous object.
maybe you're talking about anonymous class whose instance is created when required.
Anonymous class is used when you don't need a whole object to be created and allocate it's own space permanantly but for a single step.
0
Temporary instance of a class in java is an anonymous object of that perticular class and i guess this can be used to invoke a method
well anyone can correct me if i am wrong
0
Temporary instances, as the name suggests, are temporary objects.
They are allocated the system memory as long as the code requires it and then the memory is freed up to heap memory.