Object

An object, in object-oriented programming (OOP), is an abstract data type created by a developer. It can include multiple properties and methods and may even contain other objects. In most programming languages, objects are defined as classes.

Objects provide a structured approach to programming. By defining a dataset as a custom object, a developer can easily create multiple similar objects and modify existing objects within a program. Additionally, objects provide "encapsulation," meaning the data within an object is protected from being modified or destroyed by other functions or methods unless explicitly allowed.

A simple example of an object may be a user account created for a website. The object might defined as class userAccount and contain attributes such as:

  • first name
  • last name
  • email address
  • password
  • age
  • location
  • photo

Instead of recreating these properties each time a new user account is created, a web script can simply instantiate a userAccount object. Data assigned to the object may be stored in a database if the user account is saved.

A more advanced example of an object is a character in a video game. The character might have standard attributes, such as a name, hitpoints, and movement speed. It may also contain other objects, such as weapons, armor, items, etc. In this case, the character is the "parent object" and the objects it contains are "child objects." Both the parent and child objects can have their own properties and methods. For example, the character may have methods such as "move" and "attack." The "attack" command might reference the "weapon" object, which has its own methods, such as "swing" or "thrust."

NOTE: While objects are usually associated with object-oriented programming, in general computer science terminology, an object may refer to a single programming element, such as a variable, constant, function, or method.

Updated February 28, 2019

Definitions by TechTerms.com

The definition of Object on this page is an original TechTerms.com definition. If you would like to reference this page or cite this definition, you can use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about the Object definition or would like to suggest a new technical term, please contact us.

Want to learn more tech terms? Subscribe to the daily or weekly newsletter and get featured terms and quizzes delivered to your inbox.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.