I'm form1 defines a global type variable
Public class A {}
The public A, b.
Then in the process a few times to use
B=new A (); -> Load an a file
Once again behind
B=new A (); -> Loading a file b
By this time, the above instance is A system automatic recovery? In the
CodePudding user response:
Recycling is to the operation of the object, not to the operation of the class, b=new A (); Perform 2 times, in b not yet, recycling?When b=null, can be recycled, b and c # has its own recovery mechanism, although you can manually System. GC. Collect (); With bad it will make the program runs more slowly,
CodePudding user response:
Concrete is the case, I have a list In DGV, T is stored in a different path to the fileI define A publc A CurrentObject,
The selected List line 3, I use CurrentObject=new A (); To perform different operations,
Then I click on the 5 rows, also want to use CurrentObject=new A (); Is the second,
So the last 3 lines of new A () object will be destroyed?
I click on the back to 3 lines, will regenerate again,
CodePudding user response: