How to sort list of objects using multiple fields?

We can sort list using multiple fields with Comparator. Here we are going to see two ways to do that. Let’s say we have a Student class as below. And a list of Students. private List<Student> getStudentList() { return Arrays.asList(new Student(1, “Bindu”, “IT”), new Student(2, “Sam”, “CS”), new Student(3, “David”, “IT”), new Student(4, “Anjali”, “CS”)); …

How to sort list of objects using multiple fields? Read More »

How to Make Horizontal RecyclerView Easily – Android Studio Tutorial

We can make Horizontal RecyclerView or Horizontal Scrolling in RecyclerView in Android using LinearLayoutManager. If you’ve used LinearLayout, you might have noticed that you can set the layout orientation to both horizontal and vertical. Similarly, you can set the orientation of a RecyclerView using the LinearLayoutManager that we set to the recyclerView. Let’s see how …

How to Make Horizontal RecyclerView Easily – Android Studio Tutorial Read More »

Streams in Java 8

Streams in Java – Quick Guide with Examples

Java introduced Stream API in java 8, which is useful to perform operations on collections. Java streams have definitely made processing collections and life easier. But in order to work with streams, it’s important to understand following: Functional programming Functional Interface Lambda Expression Here I am going to explain all three concepts to help you …

Streams in Java – Quick Guide with Examples Read More »