Jan 7, 2017 02:29 PM
(This post was last modified: Jan 7, 2017 02:30 PM by JuicyProgramming.)
Hello,
I am building an application for my school project and I am trying to loop through a list of Cars.
A BMW is a Car.
I am looking to do something with the attribute I have in the BMW class but I am looping through a list cars so I am unable to get the attribute only the BMW has.
if (_carList.ElementAt(idx) is BMW)
then do something with that BMW object.
The Car class only has 2 attributes but the BMW class has another one. I am trying to get the specific one for the BMW but I am only able to get the 2 car attributes. I am sure there is a quick fix for this.
Anyone? Thanks :)
Have a nice day.
I am building an application for my school project and I am trying to loop through a list of Cars.
A BMW is a Car.
I am looking to do something with the attribute I have in the BMW class but I am looping through a list cars so I am unable to get the attribute only the BMW has.
if (_carList.ElementAt(idx) is BMW)
then do something with that BMW object.
The Car class only has 2 attributes but the BMW class has another one. I am trying to get the specific one for the BMW but I am only able to get the 2 car attributes. I am sure there is a quick fix for this.
Anyone? Thanks :)
Have a nice day.


![[Image: jYK9GP1.gif]](https://i.imgur.com/jYK9GP1.gif)
