Generic return type and input parameters for C# Method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yogb21
    New Member
    • Mar 2008
    • 1

    Generic return type and input parameters for C# Method

    Hello !

    I want to know...can I write a method inside C# class which has generic input parameters and generic return type. If yes..can someone help me with such method declaration and method usage. Here by 'Generic' I mean to say the return type and input parameters can be anything integer, string, array, object...

    Thank You and Best Regards !
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    I believe that classes return values that may then be writen to the page. HTH.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by yogb21
      Hello !

      I want to know...can I write a method inside C# class which has generic input parameters and generic return type. If yes..can someone help me with such method declaration and method usage. Here by 'Generic' I mean to say the return type and input parameters can be anything integer, string, array, object...

      Thank You and Best Regards !
      Use object then? Note that in C# everything is an object. Perhaps if you could describe the problem you are trying to solve, we could provide better alternatives ...

      Comment

      Working...