2012年微软认证考试备考模拟试题4
09-04
0


 

     
10.你正在开发一个自定义事件处理去自动打印所有打开的文档。事件处理可以指定要打印的份  
数。为此,你需要开发一个传递给事件处理程序的自定义事件参数类,你应该使用下面那个  
代码段?  
A. public class PrintingArgs {  
private int copies;  
public PrintingArgs(int numberOfCopies) {  
this.copies = numberOfCopies;  
}  
public int Copies {  
get { return this.copies; }  
}}  
B. public class PrintingArgs : EventArgs {  
private int copies;  
public PrintingArgs(int numberOfCopies) {  
this.copies = numberOfCopies;  
}  
public int Copies {  
get { return this.copies; }  
}}  
C. public class PrintingArgs {  
private EventArgs eventArgs;  
public PrintingArgs(EventArgs ea) {  
this.eventArgs = ea;  
}public EventArgs Args {get { return eventArgs; }}}  
D. public class PrintingArgs : EventArgs {  
private int copies;}  
答案: B  
  

11。你使用反射(Reflection)来获得方法 MyMethod 的信息。你需要获取 MyMethod 方法是否在  
派生类中可以访问,你应该如何做?  
A.  访问MethodInfo  的IsAssembly  属性。  
B.  访问MethodInfo  的IsVirtual属性。  
C.  访问MethodInfo  的IsStatic属性。  
D.  访问MethodInfo  的IsFamily属性。  
答案: D 

    
12.你正在创建一个使用非托管资源的类。这个类引用了使用托管资源的对象。你需要确保使用  
这个类的用户在不需要类实例的时候能够够释放资源。你应该做那三个工作?  
(每个答案是解决方案的一部分)  
A.  定义一个从WeakReference  继承的类。  
B.  定义一个实现IDisposable  接口的类。  
C.  创建一个类析构函数,调用其它对象的方法去释放托管资源。  
D.  创建一个类析构函数,释放非托管资源  
E.  创建一个Dispose方法,调用System.GC.Collect  强制垃圾回收。  
F.  创建一个Dispose方法,释放非托管资源并且调用其它对象的方法释放托管资源。    
答案: B, D, F  
 

相关内容

热门资讯

2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题8
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题6
微软认证考试基于.NET的We... 微软认证考试基于.NET的Web应用程序开发模拟试题四
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题4
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题5
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题10
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试经典试题2
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试经典试题7
2012年微软认证考试备考模拟... 2012年微软认证考试备考模拟试题5
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试经典试题1