NEW operator
-
Class A{...} void main() { Object o; o=new int(); o=new String(); o=new A(); } What will o eventually point to? if eventually o point to A, then what happen to int and String object? Thanks in advance
-
Class A{...} void main() { Object o; o=new int(); o=new String(); o=new A(); } What will o eventually point to? if eventually o point to A, then what happen to int and String object? Thanks in advance
loke6258038 wrote:
What will o eventually point to?
An instance of class A
loke6258038 wrote:
if eventually o point to A, then what happen to int and String object?
The garbage collector will eventually get them.
Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) My website | Blog