Podcast
Questions and Answers
C# provides ______ that shorten the syntax for single-line methods.
C# provides ______ that shorten the syntax for single-line methods.
expression-bodied members
A local function is a function declared inside another ______.
A local function is a function declared inside another ______.
function
Static methods can be called directly without creating a class ______.
Static methods can be called directly without creating a class ______.
instance
The previous method can be rewritten using ______ that shorten the syntax for single-line methods.
The previous method can be rewritten using ______ that shorten the syntax for single-line methods.
Signup and view all the answers
A local function is a function declared inside another ______.
A local function is a function declared inside another ______.
Signup and view all the answers
You can define a local function that can be called only within the method where the local function is defined. This prevents the local function from accessing the main method variables directly. To prevent this type of mistake, add the ______ modifier to the local function:
You can define a local function that can be called only within the method where the local function is defined. This prevents the local function from accessing the main method variables directly. To prevent this type of mistake, add the ______ modifier to the local function:
Signup and view all the answers
The default manner in which a value type parameter is sent into a function is by ______. A copy of the data is passed into the function.
The default manner in which a value type parameter is sent into a function is by ______. A copy of the data is passed into the function.
Signup and view all the answers
Methods taking output parameters (via the out keyword) must assign them to a value before exiting the method scope. This method returns the sum of two integers using the ______ modifier.
Methods taking output parameters (via the out keyword) must assign them to a value before exiting the method scope. This method returns the sum of two integers using the ______ modifier.
Signup and view all the answers
You can use parameter modifiers to control how arguments are passed to a method. When a parameter does not have a modifier, the behavior for value types is to pass in the parameter by ______.
You can use parameter modifiers to control how arguments are passed to a method. When a parameter does not have a modifier, the behavior for value types is to pass in the parameter by ______.
Signup and view all the answers
The contained Add() method can be called only from the wrapping AddWrapper() method. To prevent this type of mistake, add the ______ modifier to the local function:
The contained Add() method can be called only from the wrapping AddWrapper() method. To prevent this type of mistake, add the ______ modifier to the local function:
Signup and view all the answers