?
Solved

How can i create and use Generic in C# 4.0?

Posted on 2011-03-25
3
Medium Priority
?
300 Views
Last Modified: 2013-12-17
I need a manual or tutorial with examples of how to  use Generic and when to use them.

I am studying Thread right now and I need to know how Generics come into place.

Also, I need to have a clear picture of when to use them and when not.

Thank you for your help.
0
Comment
Question by:iscivanomar
3 Comments
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 1000 total points
ID: 35213969
Generics and threads are two different things, don't confuse them.

A thread will allow you to for example perform a long calculation AND have the main window still respond to the user.

A generic will allow you to have one function that can work with many different types of objects.
0
 
LVL 27

Assisted Solution

by:nmarun
nmarun earned 1000 total points
ID: 35214625
As Andy said, they are two different things.

I'm sure you're reading your previous question about threads:
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_26909278.html

Just keep that on a different 'compartment' and then read this about Generics:
http://msdn.microsoft.com/en-us/library/ms379564%28v=vs.80%29.aspx

Arun
0
 

Author Closing Comment

by:iscivanomar
ID: 35215117
Thank you AndyAinscow for you short but precise answer.

Yes in deed, I read the other question and created some little programs to get the idea and get use to write threads. also, thank you for the manual an Generic.

Have a good day both.
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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

864 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