Browsing 7239 questions and answers with Jon Skeet
It sounds like there may well be an unprintable character between the "s" and the "". I usually use something like this to show the true contents of a string: for (int i = 0; i < text.Length; i++) { Console.WriteLine("{0:x4}",... more 1/6/2015 10:03:46 AM
Matthew's answer is probably the most appropriate way to go, but just to explain why the compiler is complaining... From the C# 5 specification, section 18.2 (pointer types): A pointer-type is written as an unmanaged-type or the... more 1/6/2015 10:00:31 AM
The class will have been loaded, but not necessarily initialized. Basically, there's a Class object available when you synchronize on it, but until something uses a member of the class, it doesn't have to be initialized. From the JVM... more 1/6/2015 3:15:18 AM
Looking at the JDK 1.8 sources, it looks like it's just a static array which is initialized as part of class initialization - it only caches the values 0 to 10 inclusive, but that's an implementation detail. For example, given... more 1/5/2015 8:53:24 AM
You need to understand the difference between the compile-time type of a variable, and the execution-time type of its value. The compiler uses the compile-time type to look up members (e.g. methods) and work out what conversions are... more 1/4/2015 5:04:06 PM
If you mean you want to refer to the lambda expression you're defining within that lambda expression, I don't believe there's any such mechanism. I know of a few cases where it would be useful - recursive definitions, basically - but I... more 1/4/2015 4:47:15 PM
Your first form did work in the VS2015 Preview: int i = 42; var s = "\{i}"; That compiled and ran for me. ReSharper complained, but that's a different matter. For the final release of C#, it is: var s = $"{i}"; more 1/4/2015 3:43:06 PM
Is there anyway I can know if this is a MSG message or a "Heartbeat" message? No. Protocol buffer messages don't contain any such type information. Typically the way round this is to have a "wrapper" type with a field for each message... more 1/4/2015 8:47:49 AM
In the first example, all the type information is in one place - the type of the variable is "array of dataType" so that's what the dataType[] says. Why would you have two aspects of the type information in different places - one with the... more 1/4/2015 8:13:56 AM
The problem is that subtraction is never performed on char values in Java. Instead, both operands are promoted to int (via binary numeric promotion), and the result of the subtraction is an int as well. So you'll need to cast the result... more 1/3/2015 7:47:43 PM