Where is the memory allocated when we declare static?

Possible duplicate:
static allocation in java - heaps, stacks and constant generation

its a little confusion ... the definition of static for a class, methods, and variables. In these three cases, when memory is allocated in this way.? My boss is familiar with C, he says that only variables are in heap memory, and the rest (static classes and static methods) remain in main memory. what's this? any explanation.?

another one in android using static class and static methods is best practice?

+5
source share
2 answers

Try it,

static members are stored in Method Area.

. . , .

Non-heap Memory

‘Method Area’ , . , " ".

Method Area

, ( ). , . static fields.

( , ) , JVM.

. . , .

+5

, ( ..). 1). ( ) , , , . :

.

+3

All Articles