Browsing 7239 questions and answers with Jon Skeet
A suppressed exception is one which would have happened if another exception hadn't occurred. I'm only aware of one case where this happens, which is with a try-with-resources statement. The JLS (14.20.3) says: Resources are closed in... more 10/11/2017 7:12:33 AM
The problem is that your DateTimeFormatter is using the system default time zone. Ideally, you should parse to LocalDate values instead of DateTime, but you can fix it by using UTC for the formatter anyway: DateTimeFormatter dateDecoder =... more 10/10/2017 9:54:20 AM
I want to get the time zone information for Los Angeles, now 10/10/2017 is daylight saving time So you should ask for the "America/Los_Angeles" zone. That's what it's there for. The "GMT-07:00" zone is a fixed-offset zone - it's only... more 10/10/2017 7:25:07 AM
There are two different "kinds" of tuples involved here: the .NET ValueTuple<...> types, and C# tuple types. C# tuple types can have element names; ValueTuple<...> types can't. (There's simply nowhere in the type system for... more 10/6/2017 9:03:45 AM
You're trying to create the ObjectInputStream on the same file that you're writing to - you never even get into the body of your try-with-resources block. Here's what happens: Create the FileOutputStream: file is empty Wrap it in... more 10/5/2017 2:56:56 PM
Add is a static method. You can't call static methods "via" instances in C#. That has nothing to do with it being in a different library. You can call the method as: long result = ClassLibrary2.Class1.Add(10, 20); or if you actually... more 10/5/2017 9:22:33 AM
You're trying to parse a date/time that didn't occur. We now know that this was in the Sydney time zone. At 2am on October 1st 2017 in Sydney, the clocks went forward to 3am. If you were looking at a clock every minute you'd... more 10/5/2017 9:03:07 AM
It's explained in sections 13.4.4 to 13.4.6 of the C# 5 specification. The relevant sections are quoted below, but basically if you explicitly state that a class implements an interface, that triggers interface mapping again, so the... more 10/3/2017 9:41:51 AM
Your pattern includes whitespace after the non-whitespace. That accounts for both of your questions: the space between "Derek" and "Banas" counts as part of the first match, which stops it being part of a match for "Banas" (because you'd... more 10/1/2017 8:55:10 PM
It's subtle, but I think I've got it. In JLS 15.27.3 we have: A lambda expression is congruent with a function type if all of the following are true: ... If the lambda parameters are assumed to have the same types as the... more 10/1/2017 8:29:15 AM