I'm primarily programming in c /c++ and using sometimes libraries which already written in java.
I have faced something like this Book b= new Book(); for me it's understandable and I know what new Book() mean, what I don't understand is, how an object stored to one variable b? I mean the object might be several memory blocks locations right? so when we write new Book() it's allocating memory location, and what's returning to b? the start address of the object? or it returns the *(start address of the first object) to b and then(analog to c/c++) I write "b." and not "b->" ?
what I've understood from java that object means something "concrete" in memory, like kind of data ..
** I know there's no * and pointers in java, I'm just making a visualizing to understand the issue very well because I program in c/c++ **
Another question, will the class itself occupy memory in RAM(not meaning on its objects)?
thanks in advance.
I have faced something like this Book b= new Book(); for me it's understandable and I know what new Book() mean, what I don't understand is, how an object stored to one variable b? I mean the object might be several memory blocks locations right? so when we write new Book() it's allocating memory location, and what's returning to b? the start address of the object? or it returns the *(start address of the first object) to b and then(analog to c/c++) I write "b." and not "b->" ?
what I've understood from java that object means something "concrete" in memory, like kind of data ..
** I know there's no * and pointers in java, I'm just making a visualizing to understand the issue very well because I program in c/c++ **
Another question, will the class itself occupy memory in RAM(not meaning on its objects)?
thanks in advance.
Last edited: