How does an abstract class behave in JVM environment? does it acquire space in class area(method area in jvm) when loaded by classloader?
Asked
Active
Viewed 213 times
-3
-
*"does it acquire space in class area"* What's a "class area"? – T.J. Crowder Sep 15 '16 at 09:42
-
1***sigh*** The point is that "class area" has no commonly-accepted meaning in the Java world. Say clearly what you're asking. – T.J. Crowder Sep 15 '16 at 09:46
-
1class area or method area in jvm memory – Sanidhya Kumar Sep 15 '16 at 09:46
-
This is exactly the same question -> http://stackoverflow.com/questions/20756679/how-jvm-handles-abstract-class-in-java – Sasha Sep 15 '16 at 09:48
-
1https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.5.4 – Sanidhya Kumar Sep 15 '16 at 09:58
1 Answers
1
Loading a class consumes memory, yes. (For instance, as you mention, in the method area, but not just there.) So does loading an interface (depending on whether it has default methods, it may or may not occupy any room in the method area, but it will consume memory. The class being abstract
or not has no bearing whatsoever on the amount of space the class takes up when loaded. All abstract
does is prevent you instantiating that class directly rather than as part of a subclass.

T.J. Crowder
- 1,031,962
- 187
- 1,923
- 1,875