When would you use generics in your code c#?



When would you use generics in your code c#?..

Answer / Phanindra Nath Sinha

"Generics are useful when you want to write reusable code that can work with different data types. They allow you to create a single implementation of a class or method that can handle multiple data types without having to duplicate the code for each data type."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Can I use parseint?

1 Answers  


Can a structure be inherited by a class?

3 Answers  


How are delegates chosen?

1 Answers  


How do you create user defined data types in c#?

1 Answers  


What is cshtml extension?

1 Answers  


What is an assembly qualified name

1 Answers  


What is mvc in c#?

1 Answers  


What is the difference between an integer and int?

1 Answers  


What is a boolean c#?

1 Answers  


what is a static constructor?

1 Answers  


Explain the difference between and xml documentation tag?

1 Answers  


What is the purpose of ienumerable in c#?

1 Answers  


Categories