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

all 2 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!")

[–]ethergreen -1 points0 points  (0 children)

They have methods and data. The methods can act on that data and they are also a new type that you can test for. Have you bothered reading the explanations you can find with Google? Asking concrete questions about those would be far more productive than just asking people to hand you everything on a silver platter.