when we reate object of the class in java,we allocate memory using "new" opeator,pls tell me actually how much memory is allocated for that object. eg. first f=new first(); what is the size of f?
There is no simple method in Java for finding that out. There are good reasons why you don't want to know. Java is a high-level language and the sizeof operator which is found in C was excluded. That is because its only use is for programmed memory allocation and deallocation, both potent sources of subtle and dangerous errors.