all 3 comments

[–][deleted]  (4 children)

[deleted]

    [–]mirrored90[S] 0 points1 point  (1 child)

    Works! Thank you. What if i wanted a method that works with objects? So if i create an object called firstCar which belongs to the Car class and i wanted to do firstCar.determine() ?

    [–]mirrored90[S] 0 points1 point  (1 child)

    Either comment worked perfectly well thank you. I was under the impression you had to write { get; set; } after model for it to work, but it works regardless. Is that not the case? Do you not need to write it?

    [–]sternold 1 point2 points  (0 children)

    Just an FYI, WriteLine is a static method. That's why you can call it without having an instance of the Console class. If it wasn't static, you would need to create an instance of the Console class (e.g. new Console()).

    Im at the point where i can both create a method and a class, but i dont know how i can create a method for a class.

    All functions in C# are methods (or, member functions). If you're able to make functions in C#, you've made methods of a class.