Questions tagged [object]

An object is any entity that can be manipulated by commands in a programming language. An object can be a value, a variable, a function, or a complex data-structure. In object-oriented programming, an object refers to an instance of a class.

Objects in object-oriented programming (OOP) are data structures combined with the associated processing routines. Classes are sets of objects, while objects are instances of sets. Objects have members and methods, defining their properties and their abilities. Classes can have their own members and methods, which define the properties and abilities of the set of objects. For instance, if we have a Bird class, its objects might have an age property and a fly ability, while the Bird class might have a number of birds or a migrate ability, which is applicable for the set. Class-level methods are called static, or shared. For instance, a file could be represented as an object: a collection of data and the associated read and write routines. In typical object-oriented languages, all objects are instances of classes.

Properties of an object

Three properties characterize objects:

  • Identity: the property of an object that distinguishes it from other objects
  • State: describes the data stored in the object
  • Behavior: describes the methods in the object's interface by which the object can be used

See also:

  • (Used as a template for creating new objects)
  • (Object-oriented programming)

Resource

56770 questions
10
votes
1 answer

function already defined in .obj

From what I understand, this error is caused by not properly using header guards when you have multiple files including the same file. In my case, this is the include tree that's causing the error: File A includes Z, which contains the functions I…
xcdemon05
  • 1,282
  • 4
  • 22
  • 46
10
votes
6 answers

System.arrayCopy() copies object or reference to object?

I am having a final class NameAndValue. I copied an array of NameAndValue objects using System.arrayCopy() and when I changed a NameAndValue object in copied array, it gets reflected in the original array. public final class NameAndValue { …
prasanth
  • 3,294
  • 4
  • 24
  • 40
10
votes
1 answer

What is [....] in Ruby?

I ended up accidentally doing the equivalent of this in Ruby the other night: a = *1..5 # => [1, 2, 3, 4, 5] a << a a # => [1, 2, 3, 4, 5, [...]] a.last # => [1, 2, 3, 4, 5, [...]] What is [...] and what can I do with it?
Johan Svensson
  • 323
  • 2
  • 10
10
votes
7 answers

How do you implement audit trail for your objects (Programming)?

I need to implement an audit trail for Add/Edit/Delete on my objects,I'm using an ORM (XPO) for defining my objects etc. I implemented an audit trail object that is triggered on OnSaving OnDeleting Of the base object, and I store the changes in…
ubik
10
votes
4 answers

Is class an object in object oriented language

Is class an object in object oriented language? How are Class methods accessed by just name of the class.method name? (internal working). Is this same as a object.method? And If the Class is same as object (belong to object class which is super…
Dinkar Thakur
  • 2,657
  • 1
  • 21
  • 33
10
votes
2 answers

How to print a variable with Requests and JSON

I've been programming an application that pulls information from an online API, and I need some help with it. I'm using requests, and my current code is as follows myData = requests.get('theapiwebsitehere.com/thispartisworking') myRealData =…
user1198805
  • 121
  • 1
  • 1
  • 3
10
votes
9 answers

Creating javascript objects from different files

I've been trying to do javascript for sometime now, but i want it to be "object-orientated" so I'm trying to create different javascript classes in different files and try to create an object and call it's methods in a different file function, but…
Danny
  • 7,700
  • 16
  • 46
  • 72
10
votes
2 answers

How to store a (dictionary) object in JavaScript localStorage?

I have a very simple dictionary . var meta = {'foo':'1','moo':'2'} I want to store this in the local storage and retrieve it. window.localStorage.setItem("meta", meta); var meta1 = window.localStorage.getItem("meta"); alert(meta1['foo']); The…
Akash Deshpande
  • 2,293
  • 9
  • 35
  • 77
10
votes
5 answers

foreach object/array in jQuery

I have a problem, i have X in my code, now I want to foreach this object/array its out put. - look my code. $("#denied_seekrs").click(function() { if (!isCheckedById("selectname")) { alert ("Please select…
ParisNakitaKejser
  • 7,047
  • 8
  • 42
  • 60
10
votes
3 answers

Node.js - Parse simple JSON object and access keys and values

I am new to Node and struggling to access a simple JSON object. My request.body will have JSON content similar to the following: { "store_config": [ { "name": "hello", "name2": "world" } ] } The…
Ben
  • 5,466
  • 11
  • 48
  • 64
10
votes
4 answers

Set array of object to null in C++

Suppose I have an array of objects of type Foo in C++: Foo array[10]; In Java, I can set an object in this array to null simply by: array[0] = null //the first one How can I do this in C++?
Chin
  • 16,446
  • 27
  • 96
  • 148
10
votes
3 answers

Adding Event Listeners in constructor

function Foo(elementId, buttonId) { this.element = document.getElementById(elementId); this.button = document.getElementById(buttonId); this.bar = function() {dosomething}; this.button.addEventListener('click', function(e) {this.bar();},…
user1720624
10
votes
1 answer

Huge OBJ files in VS2008 C++ compilation compared with VS6

We have a large project, >1M lines of code in about 300 DLLs. So far we've been using VS6. I've now converted everything to VS2008, all compiles, links and more importantly - runs! ==>However... the resulting compiled OBJ files are X 10 bigger and…
aabramovich
  • 209
  • 2
  • 10
10
votes
5 answers

Declare an object even before that class is created

Is there anyway to declare an object of a class before the class is created in C++? I ask because I am trying to use two classes, the first needs to have an instance of the second class within it, but the second class also contains an instance of…
Matt Pascoe
  • 7,711
  • 16
  • 40
  • 47
10
votes
11 answers

Point of initializing a class?

I'm reading a book about C# for beginners and I'm at the part "Understanding Values and References", but there is something I don't understand. What I'm seeing is that the books tries to explain this to me (and I've seen this happening in a couple…
DutchLearner
  • 335
  • 3
  • 13
1 2 3
99
100