All Questions
1,570
questions
0
votes
0
answers
74
views
JavaFX: setting list for comboBox does not work
I am working in a JavaFX project. There I have fxml included in other fxml files. Now I need to send data from the outer controller to the inner controller. I've tried it, but the combobox looses its ...
0
votes
1
answer
82
views
Size of a Kotlin class that contains custom objects as it's data members
I understand that in Kotlin(or Java) an object is a referenced type. i.e.
private var Object1: Obj1? = Obj1()
Here var Object1 is a reference(8 bytes) to the instance of class Obj1(on Heap).
Thus, If ...
0
votes
2
answers
82
views
Call by reference confusion
I was given this hypothetical block of code, where although the language used is Java, and Java uses call by value, in this case call by reference had to be used for every method call, and I had to ...
-2
votes
1
answer
71
views
Why does String passed by reference doesn't change its value? [duplicate]
Why does the piece of code bellow modifies only value in array t and doesn't change value of the string s as well? I expected that String would also be changed because of its object properties.
class ...
0
votes
1
answer
54
views
Do instance methods strongly reference their objects?
Does myObject::someMethod strongly reference myObject? For some background, consider these two classes:
class TakesRunnable {
private Runnable runner;
TakesRunnable(Runnable runner) {
...
0
votes
0
answers
20
views
Find all references to method and references to references in Java [duplicate]
I have a method in my Java application and I need to get all ways this method invoked from root of the first call inside of my application. In Eclipse I can find a nearest caller to the method but I ...
0
votes
0
answers
71
views
What is the actual value of a reference variable in java? [duplicate]
I read a lot of articles regarding this subject and I really want to understand what is the value that it's stored inside a reference variable in java. There are just too many opinions for such a ...
-2
votes
1
answer
34
views
Does setting an object reference equal to null in an array of references, delete it completely from the memory in java? If not, then how? [duplicate]
How can I delete an object reference completely from an array of references from the memory in Java? I was setting it's value to null but I am not sure of how things are working under the hood.
I ...
3
votes
1
answer
66
views
Java Member References placed in variables do not compare equal
Java 8 or Java 11 - I load a static functional interface through an enum constructor. Then I try to compare against the same member reference. Either the code won't compile, or the comparison against ...
0
votes
1
answer
55
views
Is there a way to let another array or any other data structure hold references to certain values stored in another array?
I am working on a Sudoku solver right now and currently the cells are represented as a 2d array of size 9x9.
int[][] grid = new int[9][9];
To address the different logic units in the grid (rows, ...
1
vote
2
answers
72
views
Java reference semantic and saving/loading object files
I learn that in Java, when you add object to list, you only add references so if you modify object, all lists that have the reference will change
Say that I have an ArrayList<Product> ...
4
votes
2
answers
157
views
Why does PhantomReference.get() always return null?
I know the different kinds of references, and reachability, and how the garbage collector works in general - I have also used the different types of References in some of my personal projects. However,...
0
votes
1
answer
104
views
How to count references in java correctly?
I have difficulties understanding how to correctly count a reference variables.
Example (adopted from some book for java learning):
class Car {
}
class Example {
public static void main(String[] ...
0
votes
0
answers
33
views
Problems with referencing and calling methods in another class
I am unsure how to go about setting up a method in a golf Player class. This class calls on other methods of another class called ScoreCard so I will include that class here as well.
Player class:
...
0
votes
1
answer
36
views
JAVA 20: Setting static value to a static variable sometimes return the original value of that variable. It never happened before Java 20 update [closed]
I am trying to set a single variable that can be used as common application ID that will be set in the beginning of application loading. The original variable is set to some generic String "ROOT&...