How to declare a variable that can be used by every method? | C#
问题 I want to ask you how to declare a variable that can be used by every method? I tried making the method's access type public but that didn't let me used its variable across other methods Moreover, I basically want to accumulate that variable with different values across different methods that's why I am asking this. NOTE: I want to avoid making any static classes. EDIT: For example, I did public decimal MiscMethod() { decimal value1 += 23m; } public decimal AutoMethod() { decimal value 1 +=