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
1
vote
0 answers

variable reference and mutability

I've found many articles providing examples like the following: listA = [0] listB = listA listB.append(1) print listA print listB The gaol is to show that both lists are pointing to the same object, then if that object is changed, both lists…
Harry C.
  • 41
  • 1
  • 4
1
vote
2 answers

Java: Alternative to declaring empty constructor to initialize an object from another class

I am creating a simple, text-based interactive application, where the user is prompted for input. Each input corresponds to a specific command, which invokes a certain method. Because there are many methods, I have chosen to distribute them between…
1
vote
1 answer

C# Error 'Object Reference Not Set To An Instance Of An Object'

I've read other questions about this but don't see where or why my code is throwing this error. The code I have is below, if anyone can see where i'm going wrong. private void btnSignIn_Click(object sender, EventArgs e) { …
6TTW014
  • 627
  • 2
  • 11
  • 24
1
vote
2 answers

Object reference not set to instance of object"

I am inserting values in listbox from database & retrieving text on a button click. but I'm getting the following error Object reference not set to instance of object so "selecteditem.text" does not get any value on item selected... String…
user123
  • 21
  • 1
  • 7
1
vote
1 answer

Kotlin get reference name of an object

How can I get the reference name of a Kotlin object? Say I have an object, how can I get, say, com.myapp.CustomClass@6406? My question is the reverse of How can I get a reference to a Kotlin object by name?
Jack Guo
  • 3,959
  • 8
  • 39
  • 60
1
vote
0 answers

difference between object reference of Integer class in java

I have doubt in Following code object references in java. here is the code. public class Simple{ public static void main(String args[]){ Integer a=150,b=150; System.out.println(a==b); Integer c=100,d=100; …
hariGS
  • 60
  • 1
  • 2
  • 14
1
vote
1 answer

Reference form objects in C# to avoid repeating code blocks

I've tried searching for this, but my problem might be I don;t know the correct terms to describe the problem. I have a C# form, with a number of textbox objects. At some I process the contents of each textbox in sequence as…
TenG
  • 3,843
  • 2
  • 25
  • 42
1
vote
1 answer

What exactly are the entities 'Object', 'Object Reference', 'Object Identifier', 'Object Accessors' in PHP? How they function?

Below is the text from PHP Manual : PHP treats objects in the same way as references or handles, meaning that each variable contains an object reference rather than a copy of the entire object. A PHP reference is an alias, which allows two …
PHPLover
  • 1
  • 51
  • 158
  • 311
1
vote
1 answer

How to get the handles of all open App Designer apps (uifigures)?

As mentioned in a related answer, it is possible to get the handles of all open figures using: hFigs = findall(groot, 'Type', 'figure'); but this results in a list that contains both "old" figure and "new" uifigure handles. How can I separate hFigs…
Dev-iL
  • 23,742
  • 7
  • 57
  • 99
1
vote
1 answer

How to tell if a specific app is open and retrieve its window handle?

How can we detect that an app is opened and get a handle to its app object? Before, with figure, it was practical to use some findobj on the figure 'Tag'. Then, we could check if it exists or not, and retrieve the content of the figure. But I didn't…
1
vote
1 answer

ArangoDB java-driver reuse of objects

In many of the examples using the java arangoDB driver, they use method chaining arangoDB.db("myDatabase").createCollection("myCollection", null); or arangoDB.db("myDatabase").collection("myCollection").insertDocument(myObject); Are there any…
beoliver
  • 5,579
  • 5
  • 36
  • 72
1
vote
1 answer

Alternative to "-Contains" that compares value instead of reference

I have a list of file objects, and I want to check whether a given file object appears inside that list. The -Contains operator is nearly what I'm looking for, but it appears that -Contains uses a very strict equality test where object references…
Magnus
  • 589
  • 8
  • 26
1
vote
1 answer

Method Overriding with reference passed as argument

This question is based on the concept that when I store the reference of child class into parents class variable.And, using that variable I call the method that is present in both the classes Child-Parent.Here child method should get evoked and it…
1
vote
1 answer

Java Object Reference Problems?

I have the following classes; public class Payload{ private Map map; public static Payload INSTANCE = new Payload(); private Payload(){ map = new HashMap<>(); } public Payload put(String key, Object…
SourceVisor
  • 1,868
  • 1
  • 27
  • 43
1
vote
1 answer

Generics: Why casting with wildcard and vise versa allowed in Method Parameter Passing?

I have following code: public static void swap(List list) { swapHelper(list); //1 } private static void swapHelper(List list) { swap(list); //2 } { List tW = new ArrayList<>(); List tE = new ArrayList<>(); tW =…
Ankush G
  • 989
  • 9
  • 14