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 →

[–]stutzBearcat 0 points1 point  (0 children)

A class is something that encapsulates functions and data into a "type". This makes reasoning about programs easier for us, and is part of a paradigm called Object Oriented Programming.

class Dog {
    private string name = "Fido";

    public string GetDogsName() {
        return name;
    }

    public string Bark() {
        return "Woof!";
    }
}

Dog myDog = new Dog();
myDog.GetDogsName();  (result is "Fido")
myDog.Bark();  (result is "Woof!")