Skip to content
class

File:Oop-uml-class-example.svg · Wikimedia Commons · See Wikimedia Commons

EntityQ4479242· pop 55· linked from 743 articles

Also known as cls

in object-oriented programming, a definition that specifies how an object works

AI overview

In object-oriented programming, a class is a template or blueprint that defines what properties and abilities an object will have. Classes matter because they let programmers organize code efficiently by creating multiple similar objects that all follow the same design, rather than having to write out each object's details from scratch.

AI-generated from the Wikipedia summary — may contain errors.

Wikidata facts

Show 1 more fact
Sources (1)

via Wikidata · CC0

~35 min read

Article

In programming, a class is a syntactic entity structure used to create objects. The capabilities of a class differ between programming languages, but generally the shared aspects consist of state (variables) and behavior (methods) that are each either associated with a particular object or with all objects of that class.

Object state can differ between each instance of the class whereas the class state is shared by all of them. The object methods include access to the object state (via an implicit or explicit parameter that references the object) whereas class methods do not.

Connections

Categories