70-483J Free Dumps Study Materials
Question 17: のこのゴールを達成することについて可能な方法が何であるか?
(それぞれの正解は完全な解答を提示しますが、2つを選択してください)。
A. Insert the following code segment at line 01:
# region DEBUG
Insert the following code segment at line 10:
# endregion
B. Insert the following code segment at line 01:
[Conditional("DEBUG")]
C. Insert the following code segment at line 05:
# region DEBUG
Insert the following code segment at line 07:
# endregion
D. Insert the following code segment at line 10:
[Conditional("DEBUG")]
E. Insert the following code segment at line 01:
# if DEBUG
Insert the following code segment at line 10:
# endif
F. Insert the following code segment at line 10:
[Conditional("RELEASE")]
G. Insert the following code segment at line 05:
# if DEBUG
Insert the following code segment at line 07:
# endif
Correct Answer: D G
Explanation
D: Also, it's worth pointing out that you can use [Conditional("DEBUG")] attribute on methods
that return void to have them only executed if a certain symbol is defined. The compiler would
remove all calls to those methods if the symbol is not defined:
[Conditional("DEBUG")]
void PrintLog() {
Console.WriteLine("Debug info");
}
void Test() {
PrintLog();
}
G: When the C# compiler encounters an directive, followed eventually by an #endif directive,
it will compile the code between the directives only if the specified symbol is defined. Unlike
C and C++, you cannot assign a numeric value to a symbol; the #if statement in C# is
Boolean and only tests whether the symbol has been defined or not. For example,
#define DEBUG
#if DEBUG
Console.WriteLine("Debug version");
#endif
Reference: http://stackoverflow.com/questions/2104099/c-sharp-if-then-directives-for-debug-
vs-release
2. あなたは、GetValidPhoneNumbersという名前をつけられる方法を実装しています。
GetValidPhoneNumbers()方法は、電話番号を意味するストリング価格のリストを処理し
ます。
GetValidPhoneNumbers()方法は、有効なフォーマットである電話番号だけを返さなけれ
ばなりません。
あなたは、GetValidPhoneNumbers()方法を実装する必要があります。
あなたは、コードが分割するどの2をこのゴールを達成するために使うことができますか?
(各正解は完全なソリューションを提供します。2を選択してください。)
A. Option A
B. Option B
C. Option C
D. Option D
Correct Answer: A B
Explanation
* Regex.Matches
Searches an input string for all occurrences of a regular expression and returns all the
matches.
* MatchCollection
Represents the set of successful matches found by iteratively applying a regular expression
pattern to the input string.
The collection is immutable (read-only) and has no public constructor. The Regex.Matches
method returns a MatchCollection object.
* List<T>.Add Method
Adds an object to the end of the List<T>.