Browsing 7239 questions and answers with Jon Skeet
Or is it only a matter of making sure you don't accidentally declare instance members in your class? It's that, but it's more than that: It prevents instantiation by not having an instance constructor at all (whereas all other... more 3/8/2014 9:00:24 AM
There are various options: DateFormat defaultFormat = DateFormat.getDateInstance(); DateFormat longFormat = DateFormat.getDateInstance(DateFormat.LONG); DateFormat mediumFormat = DateFormat.getDateInstance(DateFormat.MEDIUM); // etc And... more 3/8/2014 8:05:13 AM
When I run this it says that index was outside of bounds for the array but it is not Yes it is. Even if I couldn't pinpoint the problem, I'd always bet on the runtime being more accurate than the developer's opinion on this... This... more 3/7/2014 6:33:49 PM
I wonder is there a way to source link files so that the class inside a file gets project-specific unique namespace… Well you could use preprocessor directives: #if PROJECT_FOO namespace Foo #elif PROJECT_BAR namespace Bar #elif... more 3/7/2014 6:32:21 PM
Here's the process, but as a description rather than code, leaving the rest for you as an implementation exercise: Get the current time in milliseconds, and remember it for later Create an appropriate Calendar object Work out the day... more 3/7/2014 6:14:28 PM
You can't. Images typically contain a lot of data. When you convert that to text as base64 it becomes even bigger (4 characters for every 3 bytes). So yes, that will typically be very long if it's a large image. You could compress the... more 3/7/2014 4:49:33 PM
The C# compiler automatically tries appending the suffix Attribute when you're using an attribute (which is obvious syntactically). It just makes things easier. From the C# 5 spec section 17.2 (Attribute Specification): By convention,... more 3/7/2014 4:39:11 PM
It's because you're waiting on a Thread instance. Thread uses wait/notify/notifyAll internally, so you shouldn't do that yourself as well - you'll confuse Thread, and Thread will confuse you. In particular, when a thread exits, it calls... more 3/7/2014 4:07:22 PM
The problem is with your method declaration. You need to declare the type of your str parameter, like this: public static String vowel(String str) Additionally, you're only declaring str2 within your loop - so you can't use it for the... more 3/7/2014 1:03:46 PM
The problem is that you're not calling the ToString method. In this statement: num1.Text = Number1.ToString; ... ToString is a method group, which can be used for conversions to delegate types. So for example, this is... more 3/7/2014 12:38:34 PM