Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array list and inheiritance

Status
Not open for further replies.

kevinprog

Programmer
Nov 27, 2005
2
CA
Newbie C# programmer here.

I have a base class A which has a method for id. Now I have class B which inheirits from B and has a method for expiry date. Finally I have class C which inheirits from B and has a method for printing names.

If I were to instantiate each one of these types of classes and put them into an array list. How do I search for an object based on id? Or how would I search based on expiry date?
 
You can search all three classes on id, since it is inherited by all, but class A doesn't have the expiry date property/method, so you can't use that.

Regards, Ruffnekk
---
Is it my imagination or do buffalo wings taste just like chicken?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top