J
javajedi
Hi everyone,
My question is about memory management.
Here is a class:
public class A{
int a;
public int f(){ int x = 2;}
public static void main(){
A obj1 = new A();
A obj2 = new A();
}
will take place for "a" again but what about the function "f". Does it
again take place for this function?
I read about method place in heap and I think it wont take place for
methods again but I want to be sure.
What do you think?
My question is about memory management.
Here is a class:
public class A{
int a;
public int f(){ int x = 2;}
public static void main(){
A obj1 = new A();
A obj2 = new A();
}
and for function "f" but when it comes to create the second object JVMFrom the example above, JVM will take place from heap for integer "a"
will take place for "a" again but what about the function "f". Does it
again take place for this function?
I read about method place in heap and I think it wont take place for
methods again but I want to be sure.
What do you think?