Browsing 7239 questions and answers with Jon Skeet
As Lucas says, the problem will be calling ToString() when you shouldn't. Presumably your attribute should only be applied to string fields anyway, so the simplest approach is just to cast the result to string. If that cast fails, it... more 1/28/2015 10:35:36 AM
Assuming you're actually calling String.split(String), that method's documentation includes: This method works as if by invoking the two-argument split method with the given expression and a limit argument of zero. Trailing empty... more 1/28/2015 7:10:19 AM
There's no such concept as a conversion like that without encoding. You're converting between characters and bytes - those aren't the same thing, so a conversion is required, and the form of the conversion is precisely the encoding.... more 1/27/2015 8:36:15 PM
Will the timer await the callback before resetting the timer? No. There's nothing it could await, because the signature of ElapsedEventHandler has a void return type. In other words, your code is equivalent to: var timer = new... more 1/27/2015 6:16:37 PM
This is at least part of the problem: rLength = stream.Read(buf, 0, buf.Length); ... if (rLength < buf.Length) { byte[] temp = new byte[rLength]; Array.Copy(buf, temp, rLength); buf = temp; } Basically you're limiting... more 1/27/2015 5:22:37 PM
No, there's no equivalent of anonymous inner classes in C#. Typically for single-method abstract classes or interfaces, you'd use a delegate in C# instead, and often use a lambda expression to create instances. So something similar to... more 1/27/2015 1:44:36 PM
Your previous code was broken, basically. You say it worked, but I can't see that the condition would ever be false. I suspect the compiler is just smarter now than it was before. The condition... more 1/27/2015 1:26:42 PM
The problem is how you're compiling. You should generally be compiling from the "package root", ideally specifying an output root as well. For example, from the parent directory (D:\Java): > javac -d classes... more 1/27/2015 11:02:13 AM
Note : I am confused about join() method as it makes my threads run sequentially. It will do that if you have code like this: for (Runnable runnable : runnables) { Thread t = new Thread(runnable); t.start(); ... more 1/27/2015 7:18:30 AM
If there is mismatch in type or wrong sequence you get EOFException. No, that's simply not true - at least not in the general case. You'll get an EOFException if you reach the end of the data too early. If you just read the data with... more 1/27/2015 6:46:33 AM