Browsing 7239 questions and answers with Jon Skeet
Is there any way to change the getters and setters around to accomplish it. No, not really. The code: a.ClassProperty.ValueProperty = 4; is simply translated into: var tmp = a.ClassProperty; tmp.ValueProperty = 4; It's never... more 5/12/2014 9:18:20 AM
Why won't this work? You're asking whether a single value (e.getKeyCode()) is equal to both VK_Shift and VK_1. Unless those two have the same value (which they don't) the if condition can never be satisfied. The documentation makes... more 5/12/2014 9:10:20 AM
It seems to me that you should aren't currently grouping by constituency at all. The query below should get you started. var query1 = from vote in db.Votes group vote by vote.CandidateID into g select new {... more 5/12/2014 6:24:47 AM
Just compile it with a classpath which refers to the existing class files (or the jar file that contains those class files). There should be no problem. However, note that if you change any constants in the file, those changes won't be... more 5/11/2014 6:04:21 PM
You haven't shown your displaySearchResults method, but it sounds like that returns a Vector rather than an ArrayList. But fundamentally, you shouldn't care which implementation it returns - if you just cast to List<Car> instead, you... more 5/11/2014 5:50:07 PM
You're setting the time zone in your calendar, but you should be setting it in your DateFormat. Additionally, you should be using Asia/Jerusalem as the time zone name. You don't need a Calendar at all - just new Date() gives the current... more 5/10/2014 7:33:15 PM
It's not clear why you're converting to float? at all (or why you're using ulong as the index variable type...) but you just need to cast the result back to T - otherwise you can't assign it back into an array of type T[]. Additionally,... more 5/10/2014 7:23:44 PM
Yes, they're overloaded. Within a class, accessibility is irrelevant to overloading. However, accessibility matters in that it's fine to have one private method in a base class with the same signature as another method in a derived... more 5/10/2014 6:47:26 PM
It's just a matter of precedence and associativity. Your code is equivalent to: String s1 = (((50 + 40) + "Hello") + 50) + 50; So that's: String s1 = ((90 + "Hello") + 50) + 50; which is: String s1 = ("90Hello" + 50) + 50; which... more 5/10/2014 2:03:23 PM
It sounds like you need to check whether or not Rows is empty too. We don't actually know the type of Rows, but you might want: if (messages != null && messages.Rows.Count > 0 && messages.Rows[0] != null) Or you could... more 5/10/2014 1:36:22 PM