dcsimg
Main » TERM » C »

Class Keyword Definition & Meaning

A class keyword in programming is an indicator that declares a certain class. In object-oriented programming, a class contains and designs objects, holding an object's informational data and its behavioral patterns (what it can do). These behaviors are also known as methods: processes that are related to the object in question. For example, if a programmer wanted to create a class for the object refrigerator, the class could contain information about the refrigerator:

  • its stainless steel exterior
  • the three shelves
  • a produce drawer

as well as related methods and behaviors:

  • cooling the food by maintaining a specific temperature
  • opening the refrigerator and placing food inside
  • using the ice dispenser to get a drink

The class keyword (simply the word class before anything else) initiates a class declaration and is required before any class. The title of the class follows the keyword:

class  Refrigerator {   }

All other data and methods (or functions) of the class refrigerator fall between the brackets.

The class keyword and the following class title are the only prefixes required for a class. However, there are optional features that programmers can use to define a class. Programmers can create a class that is public or private and can also denote a superclass of which the current class is a part.










LATEST ARTICLES
Texting & Chat Abbreviations

From A3 to ZZZ we list 1,559 text message and online chat abbreviations to help you translate and understand today's texting lingo. Includes Top... Read More »

Huge List of Computer Certifications

Have you heard about a computer certification program but can't figure out if it's right for you? Use this handy list to help you decide. Read More »

STUDY GUIDES
Computer Architecture Study Guide

Computer architecture provides an introduction to system design basics for most computer science students. Read More »

Network Fundamentals Study Guide

Networking fundamentals teaches the building blocks of modern network design. Learn different types of networks, concepts, architecture and... Read More »

The Five Generations of Computers

Learn about each of the five generations of computers and major technology developments that have led to the computing devices that we use... Read More »