- Methods 6:24
- Defining methods 4:14
- Methods 7 questions
- Variable Scope 3:17
- Defining a Method 1 objective
- Method Arguments 4:30
- Method Return Values 6:30
- The Difference Between Printing and Returning 1:42
- Variable Scope and Method Arguments 5 questions
- Returning a Value from the Ask Method 3:30
- Method Parameters 1 objective
- Return Values 5 questions
- Return Values 1 objective
Well done!
You have completed Variable Scope and Method Arguments!
Quiz Question 1 of 5
Will the below code compile and run? If not, why not?
using System;
class Program
{
static void GetName()
{
var name = "Mike";
}
static void Main(string[] args)
{
GetName();
Console.WriteLine(name);
}
}
Choose the correct answer below: