Coding Friction


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

Java Singleton Class

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

Java Generic Interfaces

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 :

Java Lambda Expression

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

Java Functional Interface

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 …

Java Functional Interface Read More »

Java Default or static method in Interface

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();

Java Anonymous Inner Class

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 …

Java Anonymous Inner Class Read More »