Guest User

Untitled

a guest
Nov 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.26 KB | None | 0 0
  1. void Main()
  2. {
  3.  IEnumerable<int> ints = new List<int>();
  4.  IEnumerable<string> strings = new List<string>();
  5.  
  6.  var rez1=(IEnumerable<object>)ints; //compile error
  7.  var rez2=(IEnumerable<object>)strings; //works
  8.  var rez3=(List<object>)strings; //compile error
  9.  
  10. }
Add Comment
Please, Sign In to add comment