4
Answers

Why this method does not increment?

Felice Massaro

Felice Massaro

11y
957
1
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)