Browsing 7239 questions and answers with Jon Skeet
It's looking for the class de.train.Dummy1, which means it will look for a file called Dummy1.class in a directory de\train - but the file will actually be in the current directory. Options: Keep your source code where it is, but get... more 8/12/2015 10:51:32 AM
What does cause this issue? Looks like a compiler bug to me. At least, it did. Although the decimal.TryParse(v, out a) and decimal.TryParse(v, out b) expressions are evaluated dynamically, I expected the compiler to still understand... more 8/12/2015 9:42:54 AM
Yes, that's because you're using the constructor that uses the platform default encoding to convert binary data to text. It's entirely reasonable for it to create different strings on different platforms - although I suspect your... more 8/12/2015 8:49:13 AM
The immediate cause is that you're passing null into Integer.parseInt. Next you need to work out why that's happening... You're creating a new BufferedReader wrapping System.in on each iteration... that's likely to be reading more than... more 8/12/2015 8:01:34 AM
One option is to use async/await... which doesn't work with a constructor, but which can work in a static method: public static async Task<MyPage> CreateInstance() { await Task.Run(...); // Anything else asynchronous you... more 8/12/2015 6:22:46 AM
You can use getGenericReturnType which returns a Type rather than a Class, and allows you to get at all the type arguments etc. Short but complete example: import java.lang.reflect.*; import java.util.*; public class Test { public... more 8/12/2015 6:15:44 AM
You're using the raw form of Predicate<T> - using raw types is very often where you end up getting compile-time errors involving Object where you expected to be using a more specific type. All you need to do is change the... more 8/11/2015 4:59:22 PM
You certainly don't need to go via DateTime - but to get the start of a year in a particular time zone, I'd just use: var startOfYear = zone.AtStartOfDay(new LocalDate(year, 1, 1)); Note that this will be useful to get the duration... more 8/11/2015 2:25:24 PM
counting() is declared as: static <T> Collector<T,?,Long> ... whereas you're trying to use it as if it produces an Integer. If you change your code to: Map<Integer, Long> x = l.stream().collect(groupingBy(i -> i,... more 8/11/2015 1:19:55 PM
What you've got is a local variable declaration - and that isn't allowed on its own as a statement... because it's pointless. Why declare a variable that you're not going to be able to use, because it's immediately out of scope? The... more 8/11/2015 10:48:26 AM