MCQs>IT & Programming>C#>Given the method: static int Foo(int myInt, params int[] myInts, int myOtherInt) { if (myInt > 1) return myOtherInt; foreach (dynamic @int in myInts) myInt += @int; return myInt + myOtherInt; } What will 'Foo(1, 2, 3, 4, 5)' return?
C# MCQs
Given the method: static int Foo(int myInt, params int[] myInts, int myOtherInt) { if (myInt > 1) return myOtherInt; foreach (dynamic @int in myInts) myInt += @int; return myInt + myOtherInt; } What will "Foo(1, 2, 3, 4, 5)" return?
Answer
Correct Answer: Compiler error - parameter arrays must be the last parameter specified.
Explanation:
Note: This Question is unanswered, help us to find answer for this one