Browsing 7239 questions and answers with Jon Skeet
Assignment always just copies the value of one expression into a variable (or calls a property/indexer setter). In your case, with this: buffer1 = buffer2; ... the value of buffer2 is just a reference to a byte array. So after that... more 4/1/2015 7:12:31 PM
I expected that the collection "saved" into Person instance to stay how it was initialized. It's time to revisit your expectations of how reference types work in C# then :) I have an article that you might find useful... What... more 4/1/2015 7:04:52 PM
The entry set seems to be declared with an unfortunate signature. But you could iterate over the keys instead, and call getCollection for each: for (Integer key : duplicates.keySet()) { Collection<Path> paths =... more 4/1/2015 6:57:45 PM
You're comparing "April 31st" with May 1st. There is no April 31st, so it's rolling over to May 1st anyway. (Okay, it would make more sense to just throw an exception, but hey... that's far from the worst piece of API design in... more 4/1/2015 3:42:42 PM
The typical way is to provide a copy constructor within each class in the hierarchy. For example: class A { private int f1; private int f2; public A() { ... } public A(A original) { f1 =... more 4/1/2015 3:38:01 PM
Why an overload with exact signature doesn't have precedence over another overload with optional parameters in case that the overload with exact parameters overrides a base implementation? Basically this is the compiler following the... more 4/1/2015 1:48:22 PM
A .tgz file wouldn't normally be extracted to a .gz file - it would be extracted to a .tar file. (A .gz file is gzipped; a .tar file is an uncompressed archive containing multiple files; a .tgz is a .tar file that's then been gzipped -... more 4/1/2015 12:15:17 PM
EnumMemberNameAttribute only affects serialization: The EnumMemberAttribute enables fine control of the names of the enumerations as they are serialized. It doesn't have any effect on the result of calling ToString() on the value,... more 4/1/2015 4:48:04 AM
// should create a empty point array for later use but doesn't. No, what you've specified just isn't valid syntax. If you want an empty array, you could use any of: Point[] listapontos = new Point[0]; Point[] listapontos = new... more 4/1/2015 4:22:34 AM
Personally, I wouldn't use double at all - I'd just pick a random integer between 0 (inclusive) and the total number of marbles (exclusive). Effectively, you'd be "labelling" each marble with a number, and then working out which marble was... more 4/1/2015 12:57:58 AM