in the method? I tried to change the in int x parameter in the method but it rose an error told that in is readonly. Am I right?
Keyword in is rarely used (except in the context of contravariant generic methods). So just don't use it
Thank you. But is my understanding correct?
Well the compiler told you: in arg makes the arg read-only out arg makes the arg write-only So with in, you can't use operators like ++ that modify the value of arg
Обсуждают сегодня