Browsing 7239 questions and answers with Jon Skeet
So my question is just what is this 196 ? It's the UTF-16 code unit for 'a' (which is 97) followed by the UTF-16 code unit for 'c' (which is 99). Other than for string concatenation, operands of the addition operator undergo binary... more 10/27/2013 9:01:37 PM
Yes, this is behaving as documented: Creates an ObjectInputStream that reads from the specified InputStream. A serialization stream header is read from the stream and verified. ... Throws: IOException - if an I/O error... more 10/27/2013 8:49:22 PM
You're reading an RTF (Rich Text Format) document. It does contain all that data - it's just that if you open it in an editor which understands RTF as a format, it will format the text for you using the information rather than displaying... more 10/27/2013 8:43:14 PM
If you want to know the time of day, in seconds since midnight, it would be easiest to just use getMillisOfDay(): int secondsOfDay = localDateTime.getMillisOfDay() / 1000; (Use DateTimeConstants.MILLIS_PER_SECOND if you really want to -... more 10/27/2013 7:26:23 PM
Presumably because you've got multiple threads locking on the same object. The whole point of a lock statement is that only one thread can acquire any particular monitor at a time. If they didn't do that, they'd be pretty pointless! If... more 10/27/2013 6:12:30 PM
Yes, you can use LINQ: AnotherDict = Dict.Select(d => d.ToDictionary(pair => pair.Key, pair => Convert(pair.Value))) .ToList(); Where Convert is whatever... more 10/27/2013 9:26:27 AM
The problem is that in order to create an LStore instance, you create an LAddClass - and in order to create an LAddClass instance, you create an LStore instance. So one constructor is effectively calling the other, which is calling the... more 10/27/2013 9:21:58 AM
I would like to do fruit.toString() and have it run the Apple.toString() or Banana.toString() method based on what the fruit actually is. That's exactly what will happen automatically, so long as you're really overriding the existing... more 10/27/2013 9:12:08 AM
This is the problem: addition(tokens, value); You're calling the method, but ignoring the return value. You should always be wary when you're calling a non-void method, but ignoring the return value. I suspect you want: value =... more 10/26/2013 6:34:48 PM
Currently you can't implement even equals in a way which obeys the contract of Object.equals which statesstates: The equals method implements an equivalence relation on non-null object references: ... It is transitive: for... more 10/26/2013 5:57:36 PM