|
-
November 29th, 2004, 02:00 PM
#1
Nested Class Inheritance
ok, so I am trying to inherit a nested set and overide a few functions it.
public class tree {
public Node myNode;
public void buildNode() {
myNode = new Node();
}
public class Node {}
}
public class usertree : tree {
public class Node : tree.Node {
int i;
public Node() { i = 5; }
}
}
usertree T = new usertree();
t.buildNode();
when I do this T.buildNode calls the constructor of the tree.Node class, not the usertree.Node class... is it possible to get it to call the later? something like a virtual class? (for note: In the actual application there is alot more in the buildNode function so I don't want to simply duplicate it into the usertree class.)
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|