Class (Computer Programming)
Jump to navigation
Jump to search
A Class (Computer Programming) is an Object-Oriented Programming that ...
- AKA: Class (Computer Programming).
- See: Object-Oriented Programming, Object (Object-Oriented Programming), Member Variable, Method (Computer Programming), Constructor (Object-Oriented Programming), Subroutine, Data Type, Instance (Computer Science), Instance Variable, Class Variable, First-Class Citizen, Metaclass.
References
2014
- (Wikipedia, 2014) ⇒ http://en.wikipedia.org/wiki/class_(computer_programming) Retrieved:2014-8-9.
- In object-oriented programming, a class is an extensible program-code-template for creating objects, providing initial values for state (member variables) and implementations of behavior (member functions, methods). In many languages, the class name is used as the name for the class (the template itself), the name for the default constructor of the class (subroutine that creates objects), and as the type of objects generated by the type, and these distinct concepts are easily conflated. When an object is created by a constructor of the class, the resulting object is called an instance of the class, and the member variables specific to the object are called instance variables, to contrast with the class variables shared across the class.
In some languages, classes are only a compile-time feature (new classes cannot be declared at runtime), while in other languages classes are first-class citizens, and are generally themselves objects (typically of type
Class
or similar). In these languages, a class that creates classes is called a metaclass.
- In object-oriented programming, a class is an extensible program-code-template for creating objects, providing initial values for state (member variables) and implementations of behavior (member functions, methods). In many languages, the class name is used as the name for the class (the template itself), the name for the default constructor of the class (subroutine that creates objects), and as the type of objects generated by the type, and these distinct concepts are easily conflated. When an object is created by a constructor of the class, the resulting object is called an instance of the class, and the member variables specific to the object are called instance variables, to contrast with the class variables shared across the class.