How can I supress a property or method from a base-class in a derived class in VB.NET?

You Cant! Reason: Breaks object orientedness! Suppose you have: public void ThisIsAMethod(Airplane plane) { plane.

Start_engines(); } Now you use it as such: Airplane aPlane = new Glider(); ThisIsAMethod(aPlane) Oh no, aPlane is really a glider, and hence you shouldn't be able to call it. However, it is an airplane and thus has the method Solution: Form a true inheritence. A glider is not an airplane.

Maybe you can have a base class for "FlyingMachine" or "WingedFlier" or something which they both extend Hackmode! In Glider: Protected Friend Sub start_engines() throw new NotSupportedException() End Sub.

You Cant! Reason: Breaks object orientedness! Suppose you have: public void ThisIsAMethod(Airplane plane) { plane.

Start_engines(); } Now you use it as such: Airplane aPlane = new Glider(); ThisIsAMethod(aPlane); Oh no, aPlane is really a glider, and hence you shouldn't be able to call it. However, it is an airplane and thus has the method. Solution: Form a true inheritence.

A glider is not an airplane. Maybe you can have a base class for "FlyingMachine" or "WingedFlier" or something which they both extend. Hackmode!

In Glider: Protected Friend Sub start_engines() throw new NotSupportedException() End Sub.

1 Multiple exclamation marks are a sure sign of a diseased mind. – CodeInChaos Apr 7 at 13:28 I just got really excited while answering ;) – tster Apr 7 at 13:29 +0.49. Any airplane should be able to start_engines() without worrying about the operation not being supported, as it's part of the interface.(Note, though, that start_engines() doesn't necessarily have to do anything, aside from presumably making the plane ready to move.

A glider having no engines to start, it could just return. ) Likewise, num_engines could always return 0.(It should really be read-only or 'private set' anyway! Planes shouldn't be able to change their engine count.) But yes, if a glider is used differently from an airplane, one should not inherit from the other.

– cHao Apr 7 at 13:35 Yes, I think that there is a question about conceptual designing of the classes. I just wondering if it would be possible. – darth_alexious Apr 7 at 13:47.

I suspect you're looking to use an interface. msdn.microsoft.com/en-us/library/h9xt0sd....

– darth_alexious Apr 7 at 13:44 It's been a while since I had my head in any of my VB code, will have to get back to you on that. – Tass Apr 7 at 14:50.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions