Lambda Expression vs Anonymous Inner class java by devs5003 - May 24, 2020July 7, 20220 Use of Lambda Expression vs Anonymous Inner class Before going through the topic Lambda Expression vs Anonymous Inner class, we should have some glimpse on how these two look like. To proceed further we will have an example. Suppose we have to perform sorting on some set of Strings. For that we will take an array to given Strings, then we will implement the Comparator interface to sort them. First, we will implement it using anonymous inner class, then by using Lambda Expression in order to have clear picture on both. public class SortingTest { public static void main(String[] args) { String [] mobiles = {"Samsung", "Lenovo", "Xiaomi", "Oppo", "Apple", "Sony", "Blackberry"};