Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Answers for Microsoft .NET Online Test - Online Exam - Online Quiz - Mock Test

←Go Back to Online Practice Test

Ques. You write a class named Employee that includes the following code
segment.
public class Employee {
string employeeId, employeeName, jobTitleName;
public string GetName() { return employeeName;
}
public string GetTitle() {
return jobTitleName;
}
You need to expose this class to COM in a type library. The COM
interface must also facilitate forward-compatibility across new
versions of the Employee class. You need to choose a method for
generating the COM interface.
What should you do?
Option 1. Add the following attribute to the class definition. [ClassInterface(ClassInterfaceType.None)] public class Employee {
Option 2. Add the following attribute to the class definition. [ClassInterface(ClassInterfaceType.AutoDual)] public class Employee {
Option 3. Add the following attribute to the class definition. [ComVisible(true)] public class Employee {
Option 4. Define an interface for the class and add the following attribute to the class definition. [ClassInterface(ClassInterfaceType.None)] public class Employee : IEmployee {

Ans. Option 4

Please provide the reason below. The best provided reason will be displayed with your name(if you are logged-in) on website.
Enter Reason
 
Is it helpful? Yes No
©2024 WithoutBook