public Class A {
public static String s = "s";
public static int i = 0;
public int j = 1;
public static String getStaticString() {
int k = 2;
return s;
}
public String getString() {
int l = 3;
return "something";
}
}
In Java, static variables are stored in Perm generation of Heap Segment, and primitive local variables are stored in Stack Segment.
So where is i, j, k, l stored? Where is function getString() stored?
Stack Segment" ... are you sure you read that right, or maybe there was a word missing, such as "primitive local variables"? I think what you said about static variables applies to all static variables of any type.