Browsing 7239 questions and answers with Jon Skeet
However, times using this pattern end up using the daylight status of the time as opposed to the current daylight status. This means that times look something like: 16:15:32 10/25/13 CDT even though we have now transitioned to... more 11/6/2013 3:53:31 PM
When a class explicitly implements an interface why do you need to explicitly cast the class instance to interface in order to use implemented method? The member effectively doesn't exist on the class, as far as the compiler's... more 11/6/2013 3:47:25 PM
I suspect that this: foreach (CustomerLead i in target.addressList) { expected.Add(lead); } should be: foreach (CustomerLead i in target.addressList) { expected.Add(i); } Otherwise you're adding the same reference three... more 11/6/2013 3:23:06 PM
You should parameterize your SQL, and call prepareStatement: String sql = "insert into abcnews_topics VALUES (null, ?)"; try (PreparedStatement statement = connection.prepareStatement(sql)) { statement.setString(1, textTopic); ... more 11/6/2013 3:01:15 PM
Use the NetworkCredentials constructor overload taking SecureString instead. The whole reason for that overload is to avoid this problem. You shouldn't go trying to mutate System.String instances. (It's certainly possible with reflection,... more 11/6/2013 10:29:12 AM
Yes, this isn't an official term - as far as I can tell, there is no one official term for the three similar constraints listed as class-type, interface-type or type-parameter in the constructions shown in section 10.1.5 of the C#... more 11/6/2013 10:00:41 AM
My guess is that the class is actually in a package. Class.forName takes the fully-qualified name, as document: Parameters: className - the fully qualified name of the desired class. For example: package foo.bar; class Document... more 11/6/2013 7:24:22 AM
The path shouldn't contain the executable itself - just the directory containing java.exe. So you want this on your path: C:\Program Files (x86)\Java\jre7\bin Restart your console, check that the path is correct (just run path and look... more 11/6/2013 7:05:14 AM
Why not just take the first element? return set.iterator().next(); If it's guaranteed to be non-empty, and you don't care which element you retrieve, this sounds about as simple as it gets. more 11/5/2013 8:10:09 PM
I suspect you're starting it with: java chatClient You need to specify the login name and who you want to chat with, e.g. java chatClient fred george Otherwise args will be an empty array, so evaluating args[0] or args[1] in main... more 11/5/2013 7:59:43 PM