Felice Massaro

Felice Massaro

  • NA
  • 17
  • 8.1k

Why this method does not increment?

May 26 2013 11:29 AM
May be I had to much drinks last night. Why this method does not increment the value of "number" by 1 every time I receive the value  "1" in "getTurns"?


class Turns

    {

        private int number;


        public void Counts(int getTurn, out int getBack)

        {

            if (getTurn.Equals(1))

            {

                number++;

            }

           

            getBack = number;


        }

    }



Answers (4)