Method should return multiple values

后端 未结 7 1094
执笔经年
执笔经年 2020-12-19 09:10

Hii

I have method in C#, I have to return multiple values from that method with out using collections like arrays. Is there any reliable way ?

7条回答
  •  时光取名叫无心
    2020-12-19 09:16

    Why should using 'out' being an unreliable way? (Or did you make a typo and meant without?)

    There are several methods:

    • Return a object which holds multiple values (struct/class etc)
    • out
    • ref

提交回复
热议问题