I still don't understand what really an object is , we all know that an object is the instance of a certain class(blue print), see the following:
class A{
static int x ;
int y;
static void meth1(){
int a;
}
void meth2(){
int b;
}
}
I've read from many resources that:
- static ,non-static methods and their local variables are stored in the stack.
- static variables are stored in the heap.
- the object is stored in the heap.
- instance variables are stored with the object in the heap.
But questions are :
- what is really the object?
- depending on the example above , could you give me a divide between members that go on the heap and others on the stack ?
Thanks in advance,