Why do we get CORS error and how to resolve it?

If you have been developing REST APIs that are consumed by front end applications, it’s likely that you’ve come across this error, which is annoying for both frontend and backend developers. So let’s start with why we get this error? It’s because browsers don’t allow application from a origin to access resources on a different …

Why do we get CORS error and how to resolve it? Read More »

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 »