Browsing 7239 questions and answers with Jon Skeet
I know Equals compare the value stored in the reference while "==" compares whether two references point to the same object. No, that's just the behaviour of the default == operator for reference types. When both sides of == have a... more 1/5/2017 7:21:52 AM
You can't, basically - not based on just the array itself. There is no difference between a value which was explicitly set to 0 and one which just defaulted to 0. You could change your array to be of type Integer[] - then you'd have null... more 1/4/2017 5:31:44 PM
Normally I'd have a "canonical" constructor which all the other constructors chain to. In your case that would involve creating an empty list though: public UniformData(string sql) : this(sql, new List<SqlParameters>()) { } public... more 1/4/2017 3:12:25 PM
So my question is, why does the expression even compile? It's an object initializer with a collection initializer value. From the C# specification section 7.6.10.2: A member initializer that specifies a collection initializer... more 1/4/2017 2:11:00 PM
You don't have a deadlock - there's an error just as you expected. The first and second tasks will throw NullPointerException, leaving only the third task running. You can see this if you surround the body of run() in a try/catch... more 1/3/2017 10:59:00 AM
You're calling Response.Redirect at the end of the method. That's going to basically terminate the request with a 302 response. The data you'd previously written to the (buffered) response is irrelevant at that point. Additionally, you... more 1/1/2017 4:17:38 PM
You can't change the parameter to have a different value assuming it's a by-value parameter, but (as always) you may be able to modify the object that the value refers to. Example: using System; using System.Text; class Test { ... more 1/1/2017 12:45:58 PM
The difference is that you've got a parameter called celestialBodyCount - which means that within the constructor, the identifier celestialBodyCount refers to the parameter, so to access the field you have to qualify it with this. You... more 12/31/2016 8:59:04 PM
You can either use gcloud auth application-default login from the command line (assuming you have the Cloud SDK installed), or generate and download a service account JSON file and then set the GOOGLE_APPLICATION_CREDENTIALS environment... more 12/31/2016 11:16:21 AM
It outputs 5 five times because by the time you're executing the actions, i is 5. There's only a single i variable, and its lifetime is extended until all anonymous functions that have captured it are eligible for garbage collection. To... more 12/31/2016 10:48:04 AM