Methods overloading with value and reference parameter types

前端 未结 4 1483
囚心锁ツ
囚心锁ツ 2021-02-14 06:24

I have the following code :

class Calculator
    {
        public int Sum(int x, int y)
        {
            return x + y;
        }



        public int Sum(o         


        
4条回答
  •  清歌不尽
    2021-02-14 06:54

    it's basically a compilation error as both ref and out are almost same. both are almost same but a value you pass a out parameter need not be initialised.

提交回复
热议问题