Solved

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

Posted on 2012-04-08
1
249 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 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now