-3

How does an abstract class behave in JVM environment? does it acquire space in class area(method area in jvm) when loaded by classloader?

1 Answers1

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