?
Solved

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

Posted on 2011-03-25
3
Medium Priority
?
290 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
[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
3 Comments
 
LVL 44

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

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

752 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