Which line of code should you use?

Posted by: Pdfprep Category: 70-483 Tags: , ,

You have the following line of code.

Type type1 = typeof^MyClass);

You need to create an object named obj that has a type of type1.

Which line of code should you use?
A . object obj = Activator .Createlnstance( "type 1" .GetType()) ;
B . type1 obj = Activator.Createlnstance(typel);
C . type1 obj = Activator.Createlnstance( "type1" .GetType());
D . object obj = Activator.Createlnstance(typ1);

Answer: D

Leave a Reply

Your email address will not be published.