Impact of Gen-AI on IT Jobs - Growth Mindset Show
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
1
Reply
How to Create Generics in .NET 2.0
sanjeev singh
17y
4.4k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
I give you an example
imagine that you have a rectangle, its dimentions could be either int, double, long and so forth
public class Rectangle <T>
{
public Rectangle()
{
}
public T width{get;set;}
public T height{get;set;}
.
.
.
}
So when the user defines his/her rectangle instance he/she also define the type of the width and the height
Rectangle<int> oRectangle = new Rectangle();
Rectangle<long> oRectangle = new Rectangle();
Rectangle<double> oRectangle = new Rectangle();
Bechir Bejaoui
17y
0
What is Reflection in ASP.NET 2.0
What is .net architecture
Message