Browsing 7239 questions and answers with Jon Skeet
I raised Roslyn issue 2110 for this - the C# 6 spec is changing to allow this. Mads Torgersen has indicated that the change is by design: The rule was well intended, in that it was supposed to minimize the risk of "moving code around"... more 4/20/2015 5:18:23 PM
The BigDecimal aspect isn't as relevant to this question as "what is the range of integers that can be exactly represented in double?" - in that every finite double value can be represented exactly by BigDecimal, and that's the value... more 4/20/2015 1:43:39 PM
This is the problem: threadArray[i] = new Thread(() => simThread(i)); You're capturing i here - the single variable which will be updated over the course of the loop, and end up with a value of threads. If the thread only actually... more 4/20/2015 10:29:39 AM
The core problem IMO is that you don't have a collection of dates - you have a collection of strings. I would recommend parsing those strings into a more suitable data type - I'd use LocalDateTime in either java.time or Joda Time if you... more 4/20/2015 6:05:37 AM
You've declared ovrxp as a local variable - it's initialized each time onDeath is called. If you want the value to persist between multiple calls to the method, you'll need to make the variable a field (part of the object itself).... more 4/19/2015 9:10:31 PM
What I am confused about is how to create a Nodatime variable for a specific time zone at a specific date/time? That's relatively easy: LocalDateTime local = new LocalDateTime(2015, 4, 17, 8, 0, 0); DateTimeZone zone =... more 4/17/2015 8:04:16 PM
When you use -jar, the CLASSPATH environment variable is ignored. The simplest approach here would probably be to use: java -cp adit.jar:/Users/koraytugay/adit-0.93/mysql-connector-java-5.1.33.jar foo.bar.MyMainClass Alternatively,... more 4/17/2015 12:30:25 PM
In this example, there's one subtle difference - in your first example, foo isn't determined to be a compile-time constant, so it can't be used as a case in switch blocks (and wouldn't be inlined into other code); in your second example... more 4/17/2015 6:07:24 AM
This is your problem: String letters = keyboard.next(); It has nothing to do with the vowel-counting part - but everything to do with reading the value. The Scanner.next() method will only read to the end of the token - which means it... more 4/16/2015 4:45:41 PM
Ideally, you'd build up a Map<String, IconImageTag> and add an appropriate method. For example: public enum IconImageTag { NONE("val1"), USD("val2"), EURO("val3"); private final String value; private final... more 4/16/2015 2:00:05 PM