Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2012-04-08
1
Medium Priority
?
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 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