Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Other Languages
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Other Languages
C# Generic Collection - List<object> vs List<string>
Bupjae Lee
Ranch Hand
Posts: 107
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
List<string> list1 = new List<string>(); List<object> list2 = new List<object>(); list2.AddRange(list1);
In C#, Above code is producing compile error:
Argument '1': cannot convert from 'System.Collections.Generic.List<string>' to 'System.Collections.Generic.IEnumerable<object>'
In
java
, similar code is compiled without error
List<String> list1=new ArrayList<String>(); List<Object> list2=new ArrayList<Object>(); list2.addAll(list1);
Am I doing something wrong with C# generic collections?
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Generics - need help
ArrayList
SCJP 6 question
Query on Generics (java 1.5 / Java 1.6)
Generics Generics Generics !!!
More...