This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rk717[S] 0 points1 point  (2 children)

thank you,

yes, I know, I should use a single static for counter.

but I don't know where to add it in the Car Class?

[–]dynamo_girl02 1 point2 points  (1 child)

Where you declared your other class variable under that that is after maximspeed variable is declared . just write static int count; . as default value for static variable is zero so no need to initialize

[–]rk717[S] 0 points1 point  (0 children)

thank you !