❔ working with classes and they arent working
FIRST FILE CODE:
second file code:
my current errors are shown in the screenshots provided...
6 Replies
autoType is a public enum
Automobile
is internal?
what error is it
also GetType
is already a method defined on object
i think
in SetType
AutoType
is misspelt
and your enum's name should have a capital at the startalso, you are coding with explicit setter and getter methods, which is common in Java but not done in C#
just use properties
we have "auto properties" for this purpose:
public int Year { get; set; }
does the same thing but better.
also, GetType
is a reserved method name, so I would avoid naming your own method thatWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.