neodatatype
Well-known member
Hi all,
Ive a problem with inheritance.
Lets see
I hoped that with the "new" keywork I can hide the method Method, cause of the "private" keyword, but I still have access to it.
How can I hide methods of a base class?
Thank you!
Ive a problem with inheritance.
Lets see
C#:
using System;
public class classBase {
public void Method(string str) {
}
}
public class classDerived : classBase {
private new void Method(string str) {
}
}
class cMain {
static void Main() {
classDerived cl = new classDerived();
cl.Condizione(3);
}
}
I hoped that with the "new" keywork I can hide the method Method, cause of the "private" keyword, but I still have access to it.
How can I hide methods of a base class?
Thank you!