Different ways to convert list to array

This post explains two ways through which we can convert a list to array. First approach is simply calling toArrayList on list instance. This method returns an Object array, When converting to array it doesn’t consider the data type of the entries in the list. Below is the code snippet list.toArray(); The second approach involves… Continue reading Different ways to convert list to array

Default Interface Example

Java 8 introduces a new feature called Default Interface. This feature allows interface creator to provide default implementations for methods, so that concrete classes that implementing the interface don’t have to provide implementations for those methods. The below code gives you an example of how to create default interface and how to use them. Interface… Continue reading Default Interface Example