Mayank

Mayank

  • NA
  • 474
  • 24.3k

Compile type error coming in List.

Jul 11 2017 7:28 AM
1.
string str="data";
object h2=str;
 
2. List<object> h1 = new List<string>();
 
3. IEnumerable<object> h3 = new List<string>();
 
First and third code working fine.
But second code is blowing error.
 
Please expain me.

Answers (4)