Browsing 7239 questions and answers with Jon Skeet
Why is that? The value of each variable is just a reference to the array. The assignment here: string[] pointToSourceArr = sourceArr; just copies the existing value of sourceArr into pointToSourceArr. It doesn't set up a... more 11/23/2014 8:49:18 AM
No, Math.random() will never return 1. It has an inclusive lower bound of 0, but an exclusive upper bound of 1.0. From the documentation - emphasis mine: Returns a double value with a positive sign, greater than or equal to 0.0 and... more 11/23/2014 8:06:58 AM
You missed this bit: by declaring at least one constructor That's what's preventing the default constructor from being created. The example given has a default access (package access) constructor: PackageOnly() { } ... so it... more 11/23/2014 7:57:02 AM
Surely, they are the same. No, they're not the same. One is Movements, and the other is ModelSet<Movement>. While every Movements instance is an instance of ModelSet<Movement>, it's entirely possible to have a... more 11/22/2014 5:49:32 PM
You're not creating any instances of NuThread. This line: NuThread t1, t2, t3; ... just declares three variables. It doesn't create any instances. You'd need something like: NuThread t1 = new NuThread(); NuThread t2 = new... more 11/22/2014 5:16:04 PM
There are a few changes you need: If you're going to call your getUserInput method from main, you either need to make it static or create an instance of your class. I'd suggest making it a static method. Currently your romanToDecimal... more 11/22/2014 4:12:32 PM
There's certainly a more concise way of doing it, in two ways: Use the overload of FirstOrDefault which takes a predicate Use the null-coalescing operator I'm going to ignore your IsBar check for now, because I don't understand how... more 11/21/2014 11:26:56 PM
It seems to me that all you need is the DateTime.TimeOfDay property. I would then recommend changing your conditions slightly if you're able to, so that the lower bound is inclusive and the upper bound is exclusive, e.g. var time =... more 11/21/2014 11:14:53 PM
Why is there <V> ScheduledFuture<V>? Because that's the type parameter and the return type. The <V> part isn't a return type, it's just saying "This is a generic method with a single type parameter, V." So we... more 11/21/2014 9:34:54 PM
If you're only interested in the part you've labeled as "anything else", you can use: if (foo.HasFlag(AmendmentTypeEnum.Item1) && (foo & ~AmendmentTypeEnum.Item1) != 0) Or just check that it isn't exactly equal to Item1: if... more 11/21/2014 9:22:27 PM