Stack Overflow. Let’s say I want to initialize a non-static class of variables, two of which are a UserID (int) and MyDictionary (Dictionary). This non-static class is declared within a static class (and initialized in one of the static class’s members).
If the script runs long and another user accesses the same page, there’s a chance the new user will alter the contents of the other user’s MyDictionary. But I don’t see how this is possible since MyDictionary is in a non-static class. Does anyone understand this? Thank you.
Stack Overflow. Let’s say I want to initialize a non-static class of variables, two
Share
So I’m assuming the code looks a little like this right?
By declaring the object inside the static class as a static variable you are basically saying “In my application I want one of these; and only one of these”; so even though the class is not static; you are still creating a static instance of it.