Browsing 7239 questions and answers with Jon Skeet
You're calling the BigDecimal(double) constructor. That's documented as: Translates a double into a BigDecimal which is the exact decimal representation of the double's binary floating-point value. The scale of the returned BigDecimal... more 11/24/2015 9:06:38 AM
The instanceof operator tests whether a reference (the left operand) refers to an object which is an instance of the class named on the right operand. Here, persona will be a reference to an instance of Class, and an instance of Class can... more 11/24/2015 7:15:37 AM
I very strongly suspect the final three digits are nothing to do with time zones, but are instead milliseconds, and yes, the Z means UTC. It's a little odd that they're using : instead of . as the separator between seconds and... more 11/23/2015 5:55:10 PM
Yes, I believe GregorianCalendar does indeed observe the Julian/Gregorian cutover - although I note that you're setting oldUtcTime to the 1st of February in 1AD, which is probably why you're seeing a difference of 20 days instead of 10... more 11/23/2015 5:26:34 PM
You should check whether the field type is primitive, and if it is, check the value against a default wrapper. For example: Map<Class, Object> defaultValues = new HashMap<Class, Object>(); defaultValues.put(Integer.class,... more 11/23/2015 8:25:14 AM
You're looking at the documentation for the wrong library. In json-simple, JSONObject extends HashMap, so you should use keySet()... or change to use the json.org library instead. more 11/21/2015 7:46:27 PM
Your first value ("Michael") isn't an integer, therefore it never gets inside of the body of the loop. Perhaps you want to change the code to loop until it reaches the end of the file, reading and printing integers, but consuming (without... more 11/20/2015 3:54:07 PM
Basically, LINQ contains very few operations which work on non-generic collections. There's no Enumerable.Where(IEnumerable, ...) for example - only Enumerable.Where<T>(IEnumerable<T>, ...). The simplest way to fix this is to... more 11/20/2015 12:54:34 PM
Well, there is the method Class.isInstance... but basically it's a lower-level operation which has specific VM support, so it makes sense for it to be an operator. Aside from anything else, there's no real need to obtain the Class... more 11/20/2015 10:25:10 AM
Given the comments, it sounds like you do just need to use unchecked arithmetic - but you should be concerned about the use of ulong in your API. If your aim is to just propagate 8 bytes of data, and interpret it as either an unsigned... more 11/20/2015 7:29:03 AM