Exam 8: Advanced Method Concepts
Exam 1: A First Program Using C42 Questions
Exam 2: Using Data42 Questions
Exam 3: Using Gui Objects and the Visual Studio Ide42 Questions
Exam 4: Making Decisions42 Questions
Exam 5: Looping42 Questions
Exam 6: Using Arrays42 Questions
Exam 7: Using Methods42 Questions
Exam 8: Advanced Method Concepts42 Questions
Exam 9: Using Classes and Objects42 Questions
Exam 10: Introduction to Inheritance42 Questions
Exam 11: Exception Handling42 Questions
Exam 12: Using Controls42 Questions
Exam 13: Handling Events41 Questions
Exam 14: Files and Streams42 Questions
Select questions type
You name an argument in a method call using its parameter name and a ____ before the value.
(Multiple Choice)
4.9/5
(43)
The rules that determine which method version to call are known as ____________________.
(Short Answer)
4.9/5
(39)
When you don't know how many arguments you might eventually send to a method, you can declare a(n) ____.
(Multiple Choice)
4.7/5
(38)
If you assign a default value to any variable in a method's parameter list, then all parameters to the right of that parameter must have ____ values.
(Multiple Choice)
4.8/5
(34)
When you use a(n) ____ parameter, the argument used to call the method must have an assigned value.
(Multiple Choice)
4.9/5
(39)
You use the keyword ____ as a modifier to indicate an output parameter.
(Multiple Choice)
4.8/5
(34)
To ensure that the original value of an argument passed to a method remains unchanged after returning from the method, you should use a reference parameter or an output parameter.
(True/False)
5.0/5
(36)
When a method call could execute multiple overloaded method versions, C# determines which method to execute using a process called ____________________.
(Short Answer)
4.8/5
(26)
Omitted ____ arguments are ignored for betterness purposes on argument conversions.
(Multiple Choice)
4.8/5
(39)
What are two options for writing a called method that results in altering a single value in the calling method?
(Essay)
4.9/5
(42)
What is the difference between a reference parameter and an output parameter?
(Essay)
4.7/5
(40)
Describe the similarities and differences among method versions when the method is overloaded.
(Essay)
4.9/5
(46)
A(n) ____ parameter to a method is one for which a value is automatically supplied if you do not explicitly send one as an argument.
(Multiple Choice)
4.7/5
(36)
Given the following two method signatures, explain the reasoning behind how the C# compiler determines which method version to invoke for the call MyMethod(12) :
private static void MyMethod( int a)
private static void MyMethod( int a, char b = 'B')
(Essay)
4.8/5
(32)
Write the DisplayStrings() method called in the code below using a parameter array declared in the method header. The method should write its arguments in a single line, followed by a newline. What will the output be after running Main() ?
using static System.Console;
class ParamsDemo
{
static void Main()
{
string[] names = {"Mark"), "Paulette"), "Carol"};
DisplayStrings("Ginger");
DisplayStrings("George"), "Maria"), "Thomas");
DisplayStrings(names);
}
}
(Essay)
4.9/5
(38)
____ involves the ability to write multiple versions of a method using the same method name.
(Multiple Choice)
4.8/5
(45)
Using a(n) ____ parameter is convenient when the variable to be passed does not have an assigned value at the time the method is called.
(Multiple Choice)
4.9/5
(35)
Overloaded methods sharing the same identifier must have the same return type.
(True/False)
4.8/5
(38)
Only one ____ keyword is permitted in a method declaration.
(Multiple Choice)
4.9/5
(42)
Suppose that you create overloaded method versions with the following declarations:
private static void MyMethod( double d)
private static void MyMethod( float f)
Would MyMethod() run if it is called with an integer argument? Describe how C# determines which, if either, method should run when MyMethod() is called.
(Essay)
4.9/5
(45)
Showing 21 - 40 of 42
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)