PrepAway - Latest Free Exam Questions & Answers

How should you complete the relevant code?

DRAG DROP
You are creating a class named Data that includes a dictionary object named _data.
You need to allow the garbage collection process to collect the references of the _data object.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct
locations in the answer area. Each code segment may be used once, more than once, or not at all. You may
need to drag the split bar between panes or scroll to view content.)
Select and Place:

PrepAway - Latest Free Exam Questions & Answers

Answer:

2 Comments on “How should you complete the relevant code?

  1. Paul says:

    I agree with the solution, but I suspect a typo in option 3:

    Original option 3: _data.Add(i, new WeakReference(new Class(i*2), false));

    Intended? option 3: _data.Add(i, new WeakReference(new Data(i*2), false));




    2



    0

Leave a Reply