私は、静的参照、静的プリミティブ、オブジェクト参照、オブジェクト自体、メソッド自体がクラス情報と共にどこに格納されるか教えてください。変数と参照はヒープまたはスタックにどこに格納されますか?
*このメモリ管理は誰に教えてくださいか?
* permgenの場所に保存されているものを教えてください。
*以下のプログラムのすべてのオブジェクト参照、オブジェクト、プリミティブデータ(静的型と非静的型の両方)に割り当てられる記憶領域(ヒープまたはスタック)を指定してください。
物事はJLSあたりの概念的あるpackage training;
public class Memory {
static int var =1;
static String s="hi";
static Threadtutorial th;// this is another class in the same project,consider this an object.
static Threadtutorial tt = new Threadtutorial();
int are =2;
int d;
static float value;
public static void main(String[] args) {
// TODO Auto-generated method stub
int a;
int b=1;
Threadtutorial th;// this is another class in the nsame project,consider this an object.
Threadtutorial tt = new Threadtutorial();
final int var =1;
value=8;
}
void somemethod(){
int ne=3;
String something;
Object ref;
Object dereee= new Object();
}
static void another(int b){
int c=b;
Object ref2;
Object der= new Object();
}
}
質問を編集して、適切な回答を特定するのに十分な詳細な特定の問題に限定してください。 **複数の異なる質問を一度に避ける**。 –
さらに質問をする前に[よく質問するには?](http://stackoverflow.com/help/how-to-ask)をお読みください。 –