Browsing 7239 questions and answers with Jon Skeet
You're importing java.sql.Date - which doesn't have a parameterless constructor. You meant java.util.Date, which does. However, there's no need to create a Date object at all in order to get the current time in... more 2/28/2014 9:29:22 AM
You're expecting double to retain the number of decimal digits - it doesn't do that. The value is always normalized. The double type is all about the magnitude of a number, not a particular decimal representation. It's suitable for... more 2/28/2014 9:10:37 AM
Absolutely - look at the various members of the System.Console class. In particular, you want the SetCursorPosition method, but if you're writing a "fancy" console app you should think about the members for using colours etc too. more 2/28/2014 8:13:55 AM
That's just how your build path is configured. Right-click on the project, select Build Path / Configure Build Path, then under "Order and Export" you can move the source folders etc up and down. more 2/28/2014 8:04:32 AM
Console.Read only reads a single character - but it will wait until you've hit enter in order to do so. So what's happening is that you're typing something then hitting enter, then Console.Read will return, then you'll try to read another... more 2/27/2014 11:43:53 PM
This is what's causing you the headache: xmlns="http://webservices.whitespacews.com/" That's setting the default namespace for the element and its descendants - so you need to look for elements with a local name of Collections and that... more 2/27/2014 11:34:41 PM
if I understand correctly, the using statement works like a try/finally Correct. so I would expect that if an exception occurs in a using statement, it should not crash the program. Incorrect. Neither try/finally nor using... more 2/27/2014 11:28:45 PM
Array variance allows you to treat a String[] as an Object[] with no problems, and you can then cast back with no problems: Object[] x = new String[] { "x", "y", "z" }; System.out.println(x.getClass()); // Prints class... more 2/27/2014 11:00:04 PM
Don't use string.Format at all - use DateTime.ToString(): string text = dt.ToString("yyyyMMddHHmmssfff", CultureInfo.InvariantCulture); Or to just go down to seconds: string text = dt.ToString("yyyyMMddHHmmss",... more 2/27/2014 10:39:36 PM
I believe the problem is the format of your Class-Path entry. As per the tutorial: You specify classes to include in the Class-Path header field in the manifest file of an applet or application. The Class-Path header takes the... more 2/27/2014 9:29:21 PM