This method will remain same for all child classes. Look below example which makes my point clear. We use Inheritance in case of Parent-Child relationshipĪnd we use Abstract class(In java) for a partial set of default implementations of methods in a class, which also can be implemented by simple Inheritance. If this annotation is used for interfaces with more than one abstract method, it will generate a compiler error.I know the fundamentals of OOP concepts For declaring Functional Interfaces annotation is optional to use. Due to which it is also known as the Single Abstract Method (SAM) interface. It is known as a functional interface because it wraps a function as an interface or in other words a function is represented by a single abstract method of the interface.įunctional interfaces can have any number of default, static, and overridden methods. What are functional or SAM interfaces?įunctional Interfaces are an interface with only one abstract method. This improves the garbage collection, auto-tuning, and de-allocation of metadata. It is not a contiguous Heap Memory and hence can be grown dynamically which helps to overcome the size constraints. MetaSpace: Java 8 stores the MetaData of classes in native memory called 'MetaSpace'. PremGen is fixed in size and cannot be dynamically resized. PremGen: MetaData information of classes was stored in PremGen (Permanent-Generation) memory type before Java 8. What is MetaSpace? How does it differ from PermGen? JVM
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |