Using @Profile on @Component annotated beans

In the previous post under Spring Core, I showed how to use “@Profile” annotation with “@Configuration” and “@Bean” annotation. In this post under Spring Core, I will show with example how to use “@Profile” annotation with “@Component” annotation. In previous post I also mentioned that “@Profile” annotation can be used with “@Configuration”, “@Bean”, and “@Component”…… Continue reading Using @Profile on @Component annotated beans

CollectionUtils containsAll method

In this post under Apache Collections, I will show with example the purpose of “CollectionUtils.containsAll” method. While developing applications we come around situations where we have to check whether elements of one collection is also present in another collection also or not. To do this, Apache Collections framework provides “CollectionUtils” utility class “containsAll” method. This…… Continue reading CollectionUtils containsAll method

Adding and accessing static members to Java Record

In this post under Java, I will show with example how to add and access static members in Java Record. Below is the structure of “Student” Record with static members Student 1 package core.record;2 3 public record Student(int id, String name, int age) {4 public static int noOfStudents;5 public static void display() {6 System.out.println(“Number of…… Continue reading Adding and accessing static members to Java Record