C E1 Competency Test
C E1 Competency Test
C E1 Competency Test
(true)
System.Int32
System.String
yes it will work with 1 warning that result is declared but never used.
although
Console.WriteLine(result)=System.Linq.Enumerable+UnionIterator2`1[System.Object]
no
error: Compilation failed: 4 error(s), 0 warnings
main.cs(12,25): error CS0246: The type or namespace name `Application' could not
be found. Are you missing an assembly reference?
main.cs(13,14): error CS0131: The left-hand side of an assignment must be a
variable, a property or an indexer
main.cs(15,31): error CS0131: The left-hand side of an assignment must be a
variable, a property or an indexer
main.cs(16,30): error CS0131: The left-hand side of an assignment must be a
variable, a property or an indexer
This study source was downloaded by 100000828534912 from CourseHero.com on 02-11-2022 04:41:39 GMT -06:00
https://www.coursehero.com/file/61642484/C-E1-competency-test/
public int Current { get { return value++; } }
}
public FooEnumerator GetEnumerator()
{
return new FooEnumerator();
}
static void Main(string[] args)
{
foreach (int x in (dynamic)new Foo())
{
Console.WriteLine(x);
if (x >= 10) break;
}
}
}
error:
Unhandled Exception:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot implicitly convert
type 'Foo' to 'System.Collections.IEnumerable'. An explicit conversion exists
(are you missing a cast?)
at (wrapper dynamic-method) System.Object:CallSite.Target
(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSit
e,object)
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet]
(System.Runtime.CompilerServices.CallSite site, T0 arg0) [0x00104] in
<23b73e5bdfc94c3fbbc925d9c8846791>:0
at Foo.Main (System.String[] args) [0x00042] in
<b1286fe853e743049fe8f192ff63763a>:0
[ERROR] FATAL UNHANDLED EXCEPTION:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot implicitly convert
type 'Foo' to 'System.Collections.IEnumerable'. An explicit conversion exists
(are you missing a cast?)
at (wrapper dynamic-method) System.Object:CallSite.Target
(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSit
e,object)
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet]
(System.Runtime.CompilerServices.CallSite site, T0 arg0) [0x00104] in
<23b73e5bdfc94c3fbbc925d9c8846791>:0
at Foo.Main (System.String[] args) [0x00042] in
<b1286fe853e743049fe8f192ff63763a>:0
This study source was downloaded by 100000828534912 from CourseHero.com on 02-11-2022 04:41:39 GMT -06:00
https://www.coursehero.com/file/61642484/C-E1-competency-test/
True
13. Contravariance interface and delegate must have _Out___ keyword declaration
for output parameter.
14. Covariance interface and delegate must have __In__ keyword declaration for
input parameter
This study source was downloaded by 100000828534912 from CourseHero.com on 02-11-2022 04:41:39 GMT -06:00
https://www.coursehero.com/file/61642484/C-E1-competency-test/
Powered by TCPDF (www.tcpdf.org)