Which of the following modifications for the code will you recommend?

Posted by: Pdfprep Category: GSSP-.NET Tags: , ,

You work as an Enterprise Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Windows client application that communicates with a business layer component using the .NET Framework.

The business layer component includes a class named MyUtility as follows:

public class MyUtility

{

public MyUtility() { }

public void ChangeData() { }

}

The application must fulfill the following criteriA.

l Create instances of the MyUtility class only within the business component.

l The application should invoke the functions within the MyUtility class.

You evaluate the code of the MyUtility class and decide it requires modification.

Which of the following modifications for the code will you recommend?

A. Change the scope of the MyUtility class to private.

B. Change the scope of the constructor to private.

C. Change the scope of the constructor to internal.

D. Change the scope of the MyUtility class to internal.

Answer: A

Leave a Reply

Your email address will not be published.