Home »
MCQs »
C# MCQs
What will be the output of the following C# code? | Question 15
62. What will be the output of the following C# code?
using System;
namespace MyApplication {
class Program {
static void Main(string[] args) {
string[] mobiles = { "iPhone", "Samsung", "Vivo"};
Console.WriteLine(mobiles);
}
}
}
- "iPhone", "Samsung", "Vivo"
- {"iPhone", "Samsung", "Vivo"}
- string[]
- System.String[]
Answer: D) System.String[]
Explanation:
In the above code, the statement Console.WriteLine(mobiles); will print the type of the variable that is System.String[].