单项选择题
要创建自定义的异常类,所以名为 ProductDoesNotExistException 的自定义的异常由用户指定的产品不可用时,会在一个新的应用程序中显示消息。此自定义的异常类将采取产品 id 作为参数的构造函数,并且公开此值通过产品 id。你现在是创建名为 UpdateProduct 的一种方法。此方法将用于生成和管理 ProductDoesNotExistException 异常,如果产品 id 变量中包含的值为 0。您需要确保适当的代码使用 UpdateProduct 方法。你应该做什么?()
A.
B.
C.
D.
点击查看答案
相关考题
-
单项选择题
You work as an application developer at Certkiller .com. Certkiller .com uses an application that calculates monthly payments based upon client input. You are currently debugging this application using the Microsoft Visual Studio 2005 IDE. The application contains the following code: public double CalculateMonthlyPayment (Single rate, double principal) { //Implementation code } You have discovered that unexpected results are being returned by the application. You would like to pause execution and display a message box containing an error message in the event of a negative or zero rate value is Passed to the CalculateMonthlyPayment method. You need to ensure that this only occurs during debugging mode. What should you do?()
A.A
B.B
C.C
D.D -
多项选择题
YouaredefiningaclassnamedMyClassthatcontainsseveralchildobjects.MyClasscontainsamethodnamedProcessChildrenthatperformsactionsonthechildobjects.MyClassobjectswillbeserializable.YouneedtoensurethattheProcessChildrenmethodisexecutedaftertheMyClassobjectandallitschildobjectsarereconstructed.Whichtwoactionsshouldyouperform?()
A.Apply the OnDeserializing attribute to the ProcessChildren method.
B.Specify that MyClass implements the IDeserializationCallback interface.
C.Specify that MyClass inherits from the ObjectManager class.
D.Apply the OnSerialized attribute to the ProcessChildren method.
E.Create a GetObjectData method that calls ProcessChildren.
F.Create an OnDeserialization method that calls ProcessChildren. -
单项选择题
You work as an application developer at Certkiller .com. You are required to launch the App.exe process, and specify sample.txt as the input file. App.exe will then use the contents of sample.txt to establish the environment’scurrent settings.You need to ensure that the code you use meets these requirements. What should you do?()
A.A
B.B
C.C
D.D
