String str1 = "Hello"; String str2 = "Hello"; if (Validator.equals(str1, str2)) { System.out.println("The strings are equal."); } else { System.out.println("The strings are not equal."); }
int num1 = 5; int num2 = 10; if (Validator.equals(num1, num2)) { System.out.println("The integers are equal."); } else { System.out.println("The integers are not equal."); }Here, the Validator equals method is used to compare two integers. Since they are not equal, the output will be "The integers are not equal." The com.liferay.portal.kernel.util package library contains utility classes that are used across the Liferay platform. It provides a wide range of methods that help developers to perform various operations efficiently.