Answer the question
In order to leave comments, you need to log in
Where will the data reside in memory?
I watched a lecture about memory in java. It's time to take the tests. I opened it and I can't get it. During the lecture, everything was clear, but now I did not answer correctly any of the first 10 questions, even at random lol.
Explain at least one question. Where will they still be? And why?
Question: In what part of memory will the numbers 0 and 1 be located?
public class App {
void f() {
Holder[][] i = {{new Holder(10, 0)}, {new Holder(1, 10)}};
}
}
class Holder {
int i;
static int j;
public Holder(int i, int j) {
this.i = i;
this.j = j;
}
}
Answer the question
In order to leave comments, you need to log in
References to objects are stored on the stack, objects themselves on the heap, primitives if they are local variables on the stack. You can forget about the perm gene :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question