Browsing 7239 questions and answers with Jon Skeet
No, you don't need to create an IFormatProvider at all. The invariant culture is fine for this (assuming the month name is always in English). You can just use DateTime.ParseExact, passing in the appropriate custom format string (quoting... more 3/24/2015 7:21:43 PM
Is there a deep equal issue here? Well yes, your equals method just checks whether the value passed to it is the same reference. Your comment says what you want to do: //Given another object, is it also a Coord with the same row and... more 3/24/2015 6:36:45 PM
Well you could use a DispatcherTimer instead, but it's probably simplest to use an async method and Task.Delay: public async void Foo(object sender, RoutedEventArgs e) { await Task.Delay(5000); DoSomething(); } more 3/24/2015 2:03:16 PM
But how can we add strings to arraylist whose type has already been specified as Integer? Because of the way Java generics was designed for backwards compatibility, with type erasure and raw types, basically. At execution time,... more 3/24/2015 1:05:59 PM
Do I actually need try.. catch in every method? No. In fact, it's harming your diagnostics by cutting off the stack trace - you won't be able to see the original full stack trace. You could fix that by just using: throw; instead... more 3/24/2015 10:27:32 AM
Your array only has one entry - which in turn has properties of "Candidate Details", "[Current Residential Address]" etc. (It's not clear whether this really need to be an array at all.) If you want to iterate over all the properties, you... more 3/24/2015 8:34:16 AM
but I do not know why the error is caused Presumably because you're not running it in a console. When you run a Java app in Eclipse, System.console() returns null, because it's not a "normal" console. (Personally I think it would be... more 3/24/2015 7:11:06 AM
You appear to be trying to provide an implementation for one specific type argument. You can't do that, and it doesn't make sense - it's not clear what would happen if the caller passed in a different type argument, e.g. Base b = new... more 3/24/2015 6:50:25 AM
Why is this not enough Because it's not a compile-time constant by the rules of JLS 15.28. Why is this not enough, what can I do (other than if-else)? Nothing, basically - unless you use a string literal, which would obviously... more 3/23/2015 6:46:59 PM
You've got three problems: You're actually running the loop 11 times: for (int i = 0; i <= ForLength; i++) // i=0 to i=10 *inclusive* You're not joining on your threads (or sleeping), so some of them may not have finished by the... more 3/23/2015 6:42:56 PM