Browsing 7239 questions and answers with Jon Skeet
MouseListener is an interface - it doesn't have any method implementations, so if you're going to use that as the basis of your anonymous inner class, you need to provide implementations for everything. If you just want to provide... more 2/27/2015 8:50:45 AM
The problem is in your bracketing for the first character in the Java code. Here's your code: GetHexVal((char)(hex.charAt(i << 1) << 4)) That's getting the character, shifting that, then calling GetHexVal. You want to shift... more 2/27/2015 6:34:10 AM
If you don't need to know about the element type, all you need to do is cast to IEnumerable: var sequence = (IEnumerable) value; foreach (var item in sequence) { // The type of the item variable is just object, // but each value... more 2/26/2015 9:46:29 PM
It seems that auto-casting to byte is not done when the value approaches the capacity of a byte. No, it happens when the value is out of range. A byte in Java is in the range [-128, 127]. So 0xcc is out of range, for example...... more 2/26/2015 4:53:12 PM
Declarations aren't "run" - they're not something that needs to execute, they just tell the compiler the type of a variable. (An initializer would run, but that's fine - you're not trying to read from the variable before assigning a value... more 2/26/2015 4:25:31 PM
This line is the immediate problem: System.out.println(index); It exists outside the body of any method, constructor or initializer - you can't do that. I suspect you meant it to be in the body of the main method. This is much more... more 2/26/2015 4:22:41 PM
Ignore exceptions here. All you're seeing is the equivalent of this: public class Parent { private readonly string message; public string Message { get { return message; } } public Parent(string message) { ... more 2/26/2015 3:02:30 PM
The Problem is, that it seems that after a Except() and Intersect() a Distinct() follows automatically Not really. It just means that it's a set-based operation - so the result will never contain two equal (under your equality... more 2/26/2015 1:56:31 PM
I tried with no success to escape it using single quotes What that doesn't actually escape anything - it just allows you to have a double-quote as part of your value. But then it means you can't have an apostrophe as part of your... more 2/26/2015 1:50:58 PM
Yes, it's possible and it means exactly the same as normal: public class Container { private class Foo { protected int field; private class FurtherNested { // Valid: a nested class has access... more 2/26/2015 1:36:18 PM