Anyone could explain what happens memory wise (Stack & Heap) in this example? If I understand it correctly, java stores objects on the heap, so i1 will be on the heap... same with string? But what about i2, considering it is a class field declaration.
public ExampleClass {
Integer i1=new Integer(1);
int i2 = 2;
String str = "abc";
}
ExampleClassobject, then where would it end up?