Browsing 7239 questions and answers with Jon Skeet
No - all members of a class are visible to each other. If you find that some members of your class shouldn't be accessing a particular member, that may indicate that you should split your class up - think about whether you could partition... more 12/9/2014 1:26:21 PM
Given that you know your input format, you should specify it with `ParseExact: DateTime dt = DateTime.ParseExact(text, "dd/MM/yyyy", CultureInfo.InvariantCulture); I would always recommend being as... more 12/9/2014 12:58:17 PM
I'm afraid the answer is basically "no". If you had expression trees instead of delegates then you could probably compare those with effort, but basically you've got references to separate methods. You'd need to inspect the IL inside the... more 12/9/2014 11:55:30 AM
When a type has a static constructor, the runtime is constrained to execute all type initialization immediately before the first use of any member of the type. When it doesn't have a static constructor, the runtime has much more freedom -... more 12/9/2014 10:00:04 AM
You're not using your uuid parameter anywhere... I suspect you actually want: return jdbcTemplate.query(sql, new Object[] { uuid }, new ResultSetExtractor<String>() { ... }); That way uuid will be used as the value for the... more 12/9/2014 8:26:35 AM
You're calling Double.parseDouble, which always uses a dot as the decimal separator - it doesn't use the default locale at all. Double.parseDouble is documented to behave like Double.valueOf(String), which has documentation including: ... more 12/8/2014 7:18:40 PM
Getting this information after you've only got an OutputStream variable feels like the wrong approach to me. After all, there's no guarantee that an OutputStream is writing to a file at all - it could be a ByteArrayOutputStream or writing... more 12/8/2014 2:31:18 PM
I would avoid having the same code in different namespaces twice to start with. Just generate the code once, but then wherever you create an instance of the web service, specify the URL you want to connect to. (You probably want to... more 12/8/2014 10:54:58 AM
Given that this is the sort of thing you're likely to need in several places, I would just create a named class to use for tests: public class FakeCallback implements Callback { private boolean wasSuccessful; private boolean... more 12/7/2014 10:31:51 PM
The problem is that when you write Connection, the compiler thinks you mean your class, rather than java.sql.Connection... and your class doesn't have a createStatement method. All you've got to do is specify the class name... more 12/7/2014 9:02:27 PM