Browsing 7239 questions and answers with Jon Skeet
It sounds like you just need to make it generic: public interface MemoryObject<T> { T FromMemory { get; } //... other properties and methods } public class MemoryObjectA : MemoryObject<List<string>> { ...... more 12/11/2013 5:09:53 PM
Okay, so now that you've shown the line that's actually blowing up: stmSql = f.conn.prepareStatement("select * from film"); And f.conn is null. That's because when you assign a value to f.conn, if anything goes wrong you print out an... more 12/11/2013 3:23:24 PM
I would strongly suggest that you take two actions: Create a new type to encapsulate the combination of TypeName, AttrType, AttrValue Change your model to contain a collection of that class rather than several separate properties. At... more 12/11/2013 2:51:18 PM
So my question is: how to declare it? You can't. All arrays in .NET are fixed size: you can't create an array instance without knowing the size. It looks to me like you should have a List<T> - and I'd actually create a class... more 12/11/2013 2:12:27 PM
I can't immediately tell you where the problem is, but I can tell you how to find out. First, remove this catch block (and indeed the try clause): catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } That is... more 12/11/2013 12:54:34 PM
The scope of the variable (the region of program text within which it is possible to refer to it without qualification) remains the same. The "lifetime" of the variable is effectively extended: the lambda expression captures the variable.... more 12/11/2013 11:23:35 AM
Why do we need to implement these interfaces to provide this functionality? So that other code can be written in terms of the interface, and work with objects of types which implement the interface without knowing about the specific... more 12/11/2013 9:29:05 AM
I'm not going to claim to be an expert in CM by any means, but I've had reasonable success with a simple "benchmark explorer" I've been writing. That uses a single "shell view" that composes two other views, each with its own ViewModel.... more 12/11/2013 7:04:39 AM
buff is never going to be null - it's the return value of readLine which is null when you reach the end of the data. That's what you need to check, typically with code which assigns the value to a variable and checks it in one go: String... more 12/10/2013 6:44:06 PM
Look at your method declaration: public ArrayList<T> inOrderIterator() It doesn't have any parameters. But look how you're trying to invoke it: inOrderIterator(currentNode.getRightChild()); ... you're specifying an argument.... more 12/10/2013 6:19:51 PM