Browsing 7239 questions and answers with Jon Skeet
Firstly, the JVM doesn't resolve overloads - the compiler does. (Whereas the JVM decided which overridden method to execute, for example.) As for why the method call becomes ambiguous - the compiler is looking for a single method where... more 6/28/2014 11:38:44 AM
String.replaceAll takes a regular expression pattern, but you don't need regular expressions at all. You can use: str = str.replace("[", "").replace("]", ""); Or you could use a regex if you wanted, replacing both in one go: str =... more 6/28/2014 8:42:20 AM
Why are they different? They're not, really. They're the same bits. It's just that Java doesn't have unsigned bytes - so any byte with the top bit set is negative. In every case like that, you'll see that Java result = Go result -... more 6/27/2014 10:28:50 PM
If you've got binary data within an XML document, I would hope that it's base64-encoded. Text data and binary data are different, and you shouldn't be trying to store arbitrary binary data in a string directly. If it is, you can just... more 6/27/2014 6:59:42 PM
Well it'll have to be just a List<object>, but this should work: // Flat list of ObjB var referenced = listA.SelectMany(x => x.ObjBs); // Concatenate listA with the flat list of ObjB var flat =... more 6/27/2014 2:52:34 PM
Given that your logic is identical except for the value in the transition rule, you can just parameterize by that: enum Element { X(Group.A, Group.B), Y(Group.B, Group.A), Z(Group.C, Group.A); private final Group group; ... more 6/27/2014 1:58:36 PM
You've specified HH in your format, which is the 24-hour format. But you've also got an AM/PM designator. As such, "03:00 PM" doesn't make sense - it's simultaneously trying to represent 3am (03 in 24 hours) and 3pm (PM in the data). It... more 6/27/2014 1:23:28 PM
The new object[1] part is how you're specifying the arguments - but you're just passing in an array with a single null reference. You want: int id = ...; // Whatever you want the value to be object[] args = new object[] { id... more 6/27/2014 1:10:30 PM
Build a DateTimeFormatter matching your pattern, and use that. Your pattern certainly isn't a "short time" pattern, given that you've got a date in there as well... For example: // Possibly MM.dd.yyyy - we don't know what 12.05.2014 is... more 6/27/2014 12:50:20 PM
This has nothing to do with it being an out parameter, or an array. You'd get the same error with: public static void ChangeStruct(myStruct foo) Your method is public, but your struct is internal (the default accessibility for any... more 6/27/2014 11:00:01 AM