Interfaces from what i have seen cant contain Fields, and both my
classes that i am using contains fields. I have it like this (just for
demonstration):
A - Car class (alot of fields for data)
AC - Array of A (field) that is dynamic so i can add and remove Array
elements (like a que/stack), alot of methods for extracting data from A
B - Bus class (alot of fields for data)
BC - Array of B (field) that is dynamic so i can add and remove Array
elements (like a que/stack), , alot of methods for extracting data from
B
C - Traffic class, witch needs both AC and BC classes, then from C i
have methods to eg. count the number of cars in A and edit one bus in
the middle of the bus array in BC.
Program D - Array of C (multiple trafic scenarios), D should be able to
loop thru all Traffic Classes in C and get the count of Cars from Class
AC
This would be very simple to do if multiple inherritance were allowed:
class C : AC, BC {}
ClassC[] D = new ClassC[5];
D[0].ACountCars or D[1].BEditBus(5).Passangers = 10
When i try to use interface in class BC i get the following error:
Error 1 Interfaces cannot contain fields
The interface BC can not handle the Array of B objects.
How do you get around this?
Patrick
*** Sent via Developersdex
http://www.developersdex.com ***