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 by Per C.

quizTest Your Knowledge

In 2009, Oracle acquired the rights to which programming language?

A
C#
0%
B
SQL
0%
C
Python
0%
D
Java
0%
Correct! Incorrect!     View the Java definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Object on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please 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 this definition or would like to suggest a new technical term, please contact us.

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.