Questions tagged [object-reference]

An Object reference is a pointer to an object stored in memory. The main difference is that the object was previously created (via a new operator, for instance) and its reference is kept via an additional variable, that is, its object reference.

An Object reference is a pointer to an object stored in memory. The main difference is that the object was previously created (via a new operator, for instance) and its reference is kept via an additional variable, that is, its object reference.

More Info

325 questions
3
votes
1 answer

Why am I getting, "Object reference not set to an instance of an object." but no line of code is implicated?

When I try to build my VB.NET solution, I get the error, "Object reference not set to an instance of an object." but in the Error List pane, the File, Line, Column, and Project columns are blank: How can I solve the problem if it won't tell me…
3
votes
1 answer

thisArg of array.forEach does not reference as expected

Given following code: const theArray = ['Audi','Volvo','Mercedes']; const myObj = {a: 7}; theArray.forEach((value, index, array) => { console.log(index + ' : ' + value); console.log(array === theArray); console.log(this.a); },…
MMike
  • 598
  • 3
  • 23
3
votes
1 answer

Using JPA Entity Inheritance with IdClass Composite Primary Key involving Object references

I am trying to use IdClass composite primary keys giving the following scenarios: Primary keys involve object reference (entity objects) Entity object in primary key are foreign keys to other entities (has OneToOne or ManyToOne mapping) The entity…
Ayemi
  • 43
  • 1
  • 4
3
votes
3 answers

What does the Free() method actually do internally and how does it handle object references?

Question In the code below a new object of type TStringList is created and passed to a procedure which is using that object. By passing the object to the method ProcToFillStringList a new object reference is created by coping the reference. My…
MUG4N
  • 19,377
  • 11
  • 56
  • 83
3
votes
1 answer

Is std::reference_wrapper similar to python's pass-by-object-reference?

While learning about Python, I've read that: Arguments are neither “passed-by-reference“ nor “passed-by-value“. They are “passed-by-object-reference”. I'm trying to understand, and compare this from a C++ perspective. Is the behaviour of…
Trevor Hickey
  • 36,288
  • 32
  • 162
  • 271
3
votes
4 answers

When is it appropriate to use reference equality vs object equality in Java?

I understand the different between these two terms and what methods you would use if you wanted to check if two objects had the references or the same value. My question is, when would you ever have to check if two objects have the same reference as…
Luis Averhoff
  • 385
  • 6
  • 22
3
votes
1 answer

How can I reference to an already declared object

Here's my problem... I'm creating a Private Messaging system. I have the main form (Form1) and the private message screen (pm_screen), When I open the Private messaging screen, I wish to send data from this form back to the original. But have no…
Daaksin
  • 834
  • 3
  • 13
  • 28
3
votes
1 answer

Understanding why/how Java's native sorting of an int array is optimized on successive sorts...so I can stop it

My program in a nutshell: I have a program that successively runs several sort algorithms against an array of ints, timing each. The GUI allows the user to select array size and a variety of random number ranges with which to fill the array to be…
ross studtman
  • 936
  • 1
  • 8
  • 22
3
votes
1 answer

LINQ DataContext.SubmitChanges() in C# Reporting "Object reference not set to an instance of an object."

I think a lot of people have had this issue but I'm not able to fix it or understand why I'm having it. I've been tearing hair out for a couple of hours now. I'm getting the error, "Object reference not set to an instance of an object." on my…
vealer
  • 625
  • 5
  • 9
3
votes
2 answers

Confused about how object references work in Java

I am confused about how object references work and was wondering if someone could help. Below is some example code which is supposed to deQueue a Queue based on a linked list for the general case: Object head = listHead.datum; listHead =…
user1058210
  • 1,639
  • 7
  • 29
  • 49
3
votes
4 answers

Java - Preferred design for using a mutable object reference in another thread?

public class ObjectA { private void foo() { MutableObject mo = new MutableObject(); Runnable objectB = new ObjectB(mo); new Thread(objectB).start(); } } public class ObjectB implements Runnable { private…
2
votes
1 answer

Does Javascript equal sign reference objects or clones them?

In MyApp.something.BigObject I have a memory expensive object and I like to do this var theObject = MyApp.something.BigObject;. My question is would that take up double the memory or not?
ilija139
  • 2,925
  • 3
  • 20
  • 23
2
votes
3 answers

C++ object referencing in classes

I am wondering how to store a reference of an object inside of another object, and also set that reference as a private property. Example (pseudo-code): class foo { public: int size; foo( int ); }; foo::foo( int s ) : size( s )…
grep
  • 3,986
  • 7
  • 45
  • 67
2
votes
3 answers

get string representation of object reference in vb.net

I want to make a hashtable of object references and I want a different object's reference to be the key. How can I do this in vb.net? In java (assuming I am using the default toString method and that add() takes a string as a key and an object ref…
Ray
  • 21
  • 2
2
votes
0 answers

Script Component Transformation row value to variable

I have a script transformation component that takes input from an OLEDB source and, for each row, executes a stored procedure with parameters based on the row value. I have used this functionality in past solutions without issue however, it's now…
jbeckom
  • 105
  • 1
  • 2
  • 10
1 2
3
21 22