Browsing 7239 questions and answers with Jon Skeet
You're performing three separate computations here. You only need one: var appointment = LocalDateTime.FromDateTime(dateTimePicker1.Value).Date; var retirement = LocalDateTime.FromDateTime(dateTimePicker2.Value).Date; var difference =... more 3/9/2015 10:27:26 AM
Since there is the implicit conversion converting long to int There isn't. There's an explicit conversion. Narrowing conversions aren't generally applied implicitly, precisely because they can lose information. So you'd need: int c... more 3/9/2015 7:14:45 AM
No, the language itself is the same - it's just a matter of the environment in which it's used, basically. It's probably more important to be aware of the differences between different versions of Java (e.g. Java 7 and Java 8) in terms of... more 3/9/2015 7:06:30 AM
Well, it's possible that the two calls wouldn't be the same, if the operator had been overloaded badly. Either there could be one overload, and it could be written in a way which compares the operands asymmetrically, or the two statements... more 3/9/2015 6:49:28 AM
Why doesn't the last block work? Because an array initializer (JLS 10.6) is only valid in either a variable declaration, as per your first and second blocks, or as part of an array creation expression (JLS 15.10.1), as per your third... more 3/8/2015 1:15:03 PM
A property is just a pair of methods, really - and if you use an automatically-implemented property, the compiler implements them for you and creates a field. You want one field - because you've only got one real value, and two views on it... more 3/7/2015 12:55:03 PM
I strongly suspect this is because the default culture on your machine is one that uses , instead of . for a decimal separator. You can use double.Parse and specify CultureInfo.InvariantCulture to parse it using the invariant culture which... more 3/7/2015 12:35:50 PM
You include the jar file in the classpath when you execute by simply putting it in that list of jar files you've already got - you're already specifying openejb-client-4.7.1.jar etc; just add javaee-api-7.0.jar to that list (with the right... more 3/7/2015 10:29:36 AM
Here, shouldn't it be Solution.solveMeFirst(a,b); You could call it that, but you certainly don't have to. The detailed rules for finding the meaning of a name are given in JLS 6.5, but basically the compiler will search through the... more 3/7/2015 10:17:19 AM
I suspect you just want: if (Config.exists()) { Configs = YamlConfiguration.loadConfiguration(Config); } (Now would be a good time to learn about Java naming conventions, by the way - variables in Java conventionally start with a... more 3/7/2015 10:00:40 AM