Browsing 7239 questions and answers with Jon Skeet
Is it possible for a Virtual Method in a Base class to reference/access/use a Static variable from a child class? No. Even aside from the static side of things, you're trying to access a variable as if variables were polymorphic.... more 12/15/2013 10:11:37 PM
You're trying to use single quotes for string literals - that's invalid in C#. Single quotes are for character literals (char). You need double quotes for string literals. You also need parentheses for a method... more 12/15/2013 9:46:41 PM
This code: this.getClass().getResource(comboFile[ctr].getPath()) ... relies on the image being available as a resource in the same classloader as the executing class. If it's just a file on the file system and the class is in a jar... more 12/15/2013 9:23:12 PM
There's no equivalent for that in C#. The generics in C# are quite different to those in Java in various ways, including the way covariance and contravariance work. You could have a generic method (or generic type) with a constraint on... more 12/15/2013 9:16:57 AM
The exception you're getting isn't from a call to Float.parseFloat. It's from a call to Integer.parseInt. Check the line number in the stack trace to find out where. I suspect you're parsing integers elsewhere, and you're just pulling the... more 12/14/2013 11:20:01 PM
It's executing exactly as documented Writes a single character. Parameters: c - int specifying a character to be written I suspect you want: out.write(String.valueOf(values[i])); This overrides Writer.write(int), which is... more 12/14/2013 10:22:28 PM
Nullable<T> is a struct, as per the documentation. It simply isn't a class. It's a value type, which looks a bit like this in terms of fields: public struct Nullable<T> { private readonly T value; private readonly bool... more 12/14/2013 9:58:59 PM
You're currently declaring local variables in the constructor. You need to declare instance variables. For example: public class Ampel { private final boolean red; private final boolean yellow; private final boolean green; ... more 12/14/2013 9:56:21 PM
Default values have to be constants - you can't provide one which depends on another variable. So this would be fine: public string this[string data, int maxOccurences = 0] but what you've got isn't valid. Admittedly the error message... more 12/14/2013 8:46:51 PM
Tim's answered most of this. For the JLS reference, from section 8.1.5: Unless the class being declared is abstract, the declarations of all the method members of each direct superinterface must be implemented either by a declaration... more 12/14/2013 11:13:25 AM