what is object

1 year ago 33
Nature

An object can have different meanings depending on the context. Here are some definitions of an object from various sources:

  • In computer science, an object can be a variable, a data structure, a function, or a method. As regions of memory, objects contain a value and are referenced by identifiers).
  • In grammar, an object is a noun or a pronoun that is acted upon by a verb or a preposition. For example, "Jack saw a ghost" (the object is "a ghost") .
  • In object-oriented programming, an object is an abstract data type with the addition of polymorphism and inheritance. An object has state (data) and behavior (code) and can correspond to things found in the real world).
  • Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes) .
  • An object is what actually runs in the computer. Each object is an instance of a particular class or subclass with the classs own methods or procedures and data variables. All individual objects possess three basic characteristics -- identity, state, and behavior.

In summary, an object can refer to a variable, data structure, function, or method in computer science, a noun or pronoun that is acted upon by a verb or preposition in grammar, an abstract data type with state and behavior in object-oriented programming, or a real-world entity with state and behavior.