PrepAway - Latest Free Exam Questions & Answers

Which code should you insert at line 16?

DRAG DROP
You have the following class. (Line numbers are included for reference only.)

You need to complete the doOperation method to meet the following requirements:
If AddNumb is passed as the operationName parameter, the AddNumb function is called.
If SubNumb is passed as the operationName parameter, the SubNumb function is called.
Which code should you insert at line 16? Develop the solution by selecting and arranging the
required code blocks in the correct order. You may not need all of the code blocks.

PrepAway - Latest Free Exam Questions & Answers

Answer: See the explanation

Explanation:
Target 1:

Target 2:

Target 3:

Target 4:

Note:
* target 2:
GetType() is a method you call on individual objects, to get the execution-time type of the object.
Incorrect: typeof is an operator to obtain a type known at compile-time (or at least a generic type
parameter). The operand of typeof is always the name of a type or type parameter – never an
expression with a value (e.g. a variable). See the C# language specification for more details.

What is the difference of getting Type by using GetType() and typeof()?
http://stackoverflow.com/questions/11312111/when-and-where-to-use-gettype-or-typeof

One Comment on “Which code should you insert at line 16?


Leave a Reply