Java List
List Interface is Used to store ordered values. duplicate value can be stored. it is a child interface of collection. 1. Adding Elements 2. remove , replace , and get element 3. Iterating over List
List Interface is Used to store ordered values. duplicate value can be stored. it is a child interface of collection. 1. Adding Elements 2. remove , replace , and get element 3. Iterating over List
Singleton class is a class that can have only one instance. if you create new instance it will also points to first instance. to design singleton class
Bounded type parameters allow you to set restrictions on generic type arguments Declare a bounded type parameter T can only be replaced with super class Name or it’s subclass ,For Example: This class only accepts type parameters as any class which extends class M or class M itself. Passing any other type will cause compiler …
it is used to deal with abstract data types .This is implemented for different data types. Generic interfaces are specified just like generic classes. For example :
Lambda expression provide implementation of functional interface (interface that has only one abstract method). it’s treated as function . Without lambda expression Lambda expression Examples
It’s an interface with just only one abstract method. it can have any number of default or static methods . lambdas can only operate on functional interface. it is also referred as Single Abstract Method Interfaces, or SAM Interfaces when you declare functional interface @FunctionalInterface can be added , but if you applied on that …
In interface method is by default public abstract . when abstract class implements interface a method which are defined in interface we don’t need to implement. This is because a class that is declared abstract can contain abstract method declarations. It is therefore the responsibility of the first concrete sub-class to implement any abstract methods …
Default Method default method is used to provide common functionality to class. it can be override by implemented class. Static Method static method belongs to Interface, can’t override by class. interface and implemented class both can have static method with same name without overriding each other to execute static function MyInterface.fun1();
A nested class doesn’t have any name is Known as anonymous inner class. anonymous inner class can be used in two ways 1. for overriding purpose If the purpose of class is only to override method ex: purpose of creating B class to override fun1 in this case you don’t need to create B class …