Browsing 7239 questions and answers with Jon Skeet
File.WriteAllLines takes a sequence of strings - you've only got a single string. If you only want your file to contain that single string, just use File.WriteAllText: File.WriteAllText(@"C:\temp\WriteLines.txt", firstValue); However,... more 1/4/2014 2:26:05 PM
There's no equivalent of an assembly in Java, so there can't be an equivalent of an access modifier which makes a member available within an assembly. The closest you can get to internal is the default accessibility which is similar but... more 1/4/2014 1:23:27 PM
An indexer access expression is initially classified as an "indexer access". From section 7.6.6.2 of the C# 4 spec: The result of processing the indexer access is an expression classified as an indexer access And then from section... more 1/4/2014 10:56:01 AM
The fact that they're jagged arrays is actually irrelevant here - you've really just got two arrays which you want to concatenate. The fact that the element type of those arrays is itself an array type is irrelevant. The simplest approach... more 1/4/2014 10:18:37 AM
That line of code is outside the method - so it's render that's not being found. Additionally, you have a spurious ; in your for loop declaration: for (int y = 0; y<render.height; y++); ^--- You... more 1/4/2014 10:03:22 AM
Assuming you want compile-time safety rather than just execution-time safety, you could use generics, like this: abstract class Dice<T extends Dice> implements Comparable<T> { int value; public int compareTo(T other)... more 1/4/2014 9:56:08 AM
You've effectively got a cyclic dependency: your Looper needs to be initialized with the Commandable, and the Commandable needs to be initialized with the Looper. The compiler is absolutely right to complain - imagine if the Looper... more 1/4/2014 9:32:44 AM
Firstly, any time you convert from a double to BigDecimal you should take a step back and ask yourself whether you're really doing the right thing to start with. For example, if you've done this by parsing from a String to a double, then... more 1/3/2014 6:11:11 PM
No, it's executing the right number of times - but you're capturing i, which is incrementing before the thread gets to use it. Create a copy of i in your loop: for (int i = 0; i < nOfPlayers; i++) { int player = i; thr[i] =... more 1/3/2014 10:11:49 AM
You want the DateTime.DaysInMonth method: public bool IsDateValid(int year, int month, int day) { return day <= DateTime.DaysInMonth(year, month); } I'm assuming that the year and month values will always be sensible, and that... more 1/3/2014 9:36:00 AM