Question
What keyword modifier indicates that a method can be called by referring to the class rather than an object from the class? nonstatic internal static
What keyword modifier indicates that a method can be called by referring to the class rather than an object from the class?
nonstatic |
internal |
static |
protected |
Flag this Question
Question 16 2 pts
A formal parameter that receives a copy of the value passed to it is an example of what type of parameter?
input |
value |
output |
reference |
Flag this Question
Question 17 2 pts
What is the return type of the ReadLine() method call?
Object |
string |
bool |
int |
Flag this Question
Question 18 2 pts
Under what circumstances will a method receive the actual memory address of a passed array, and have access to the actual values in the array elements?
Only when it is passed by reference. |
Only when the array is inherited. |
Only when the array is within the method's scope. |
Only when it is passed by value. |
Flag this Question
Question 19 6 pts
Match each item with a statement below.
A method that calls another method.
A method call that requires an object reference.
A variable that is declared in the current method and is known only to that method.
A parameter that receives a copy of the value passed to it.
Variables that are declared within a class but outside of a method.
A name that includes the class name.
The return type for a method that returns either true or false.
Consists of the data types and parameter names that appear between parentheses in a method header.
A method that is called without an object reference.
Flag this Question
Question 20 2 pts
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 |
Flag this Question
Question 21 2 pts
When you use a reference parameter, any passed variable must have an assigned value.
False |
True |
Flag this Question
Question 22 2 pts
You cannot use the out or ref keywords when passing an array to a method.
True |
False |
Flag this Question
Question 23 2 pts
On occasion, you might want a method to be able to alter a value you pass to it. What type of parameter should you use in this case?
optional parameter |
reference parameter |
global parameter |
value parameter |
Flag this Question
Question 24 2 pts
What modifier is used to indicate that a parameter is used for output?
out |
get |
params |
ref |
Flag this Question
Question 25 2 pts
What type of parameter requires that the argument used to call the method must have an assigned value?
formal |
optional |
output |
reference |
Flag this Question
Question 26 2 pts
For the sake of convenience, what parameter type can be used when the variable to be passed does not have an assigned value at the time the method is called?
mandatory parameter |
value parameter |
reference parameter |
output parameter |
Flag this Question
Question 27 2 pts
How can you avoid throwing an exception during data conversion when a value cannot be converted to an appropriate type?
You can use the Convert() method to force the conversion. |
You can use the TryParse() method to attempt conversion, or assign a 0 to the variable if it is not possible. |
You can use the Parse() method, which may result in garbage being returned. |
You can use the ReadLine() method to convert the data to a string. |
Flag this Question
Question 28 2 pts
What should you utilize when you don't know how many arguments you might eventually send to a method?
reference parameter |
output parameter |
parameter array |
value parameter |
Flag this Question
Question 29 2 pts
What is a method considered to be when there is a potential for a situation in which the compiler cannot determine what method to use?
polymorphic |
hidden |
ambiguous |
overloaded |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started