Class

noun

say it: “KLAS” /klæs/

A template that describes what data and actions every object of one kind will have.

What is Class?

A class is the template for creating objects. It lists the data each object will hold and the methods it will have. One Dog class can create any number of dog objects.

public class Dog
{
    public string Name { get; set; }

    public void Bark() => Console.WriteLine(quot;{Name} says woof!");
}

In a sentence

  • “The Book class says every book has a title and a page count.”

Level: Novice · More OOP terms at this level

Updated

In other subjects