?
Solved

How can we make Generics strongly typed - C# / VB.NET

Posted on 2012-04-08
1
Medium Priority
?
267 Views
Last Modified: 2012-04-09
Hi,

Can you please let me know:

How can we make Generics strongly typed - C# / VB.NET ?

Thanks
0
Comment
Question by:milani_lucie
1 Comment
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 2000 total points
ID: 37822528
Generics by their very nature are strongly typed or Type Safe.
Type Safe means that the type supplied to a generic type will make the generic type work with that type only.

for example ArrayList is collection of objects and thus it cannot guarantee that it will contain only objects of one type(say FileStream), however A generic list List<T> will always work on collection of object of Type T where T Can be substituted with any .net type, List<FileStream> will always be a List of FileStream objects.

http://www.codeproject.com/Articles/19884/Generics-sample-in-C
http://msdn.microsoft.com/en-us/library/ms379564%28v=vs.80%29.aspx
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question