Browsing 7239 questions and answers with Jon Skeet
Yes, that will happen if FindForm() returns either null, or something that isn't an instance of IntDrawForm. There's nothing particularly specific to delegates here - you'd get a similar result if you tried this as your second... more 3/1/2016 11:49:47 AM
I suspect the problem is with the locale used in the SimpleDateFormat. By default, SimpleDateFormat takes the default locale of the system... so if you run this code in France, "Mon" won't be recognized as a day-of-week abbreviation, for... more 3/1/2016 11:07:31 AM
Just to use the values, you certainly shouldn't instantiate the class. Just because you can access static members as if they were instance members doesn't mean it's a good idea. If the class really only contains constants - and if you're... more 3/1/2016 9:11:38 AM
You're using the wrong StringUtils class. You're importing org.apache.commons.codec.binary.StringUtils, but it looks like you want org.apache.commons.lang.StringUtils or org.apache.commons.lang3.StringUtils. The first of these doesn't have... more 3/1/2016 9:06:11 AM
You've specified that there are 2870000 milliseconds - which is 47 minutes and 50 seconds. It's important to note that in SimpleDateFormat, S is a milliseconds specifier, not a "fraction of second" specifier. Basically, if you're... more 3/1/2016 8:09:36 AM
In normal English I would say, that a developer object is assignable from a human class, not the other way around. And the problem is your usage of the words "object" and "class" here. It should be: a Human variable is assignable from... more 3/1/2016 7:11:27 AM
I would suggest refactoring your code to start with - instead of having 5 "parallel collections", have a single collection of a new type, User: public class User { public string Name { get; set; } public string ImageUrl { get;... more 2/29/2016 10:00:06 PM
This is really interesting. It's a mixture of the behaviour of Type.GetType(string) in terms of the calling assembly, and how method group conversions work. First, the Type.GetType documentation includes this: If typeName includes the... more 2/29/2016 2:36:11 PM
You can't - because a Period doesn't know its start/end dates... it only knows how long it is in terms of years, months, days etc. In that respect, it's a sort of calendar-centric version of Duration. If you want to create your own, it... more 2/29/2016 11:49:16 AM
I assume that source 1.6 corresponds to the JDK that you have. So surely you only have source 1.6 if you have JDK 1.6. But have JDK 1.8 and Netbeans 8.0.2, so how come Netbeans says I use source 1.6? Well, not quite - it corresponds... more 2/28/2016 8:34:11 PM