Category Archives: Java

Java Program to check Palindrome String

This is a Java program to check if a string is a palindrome or not. A a string is a palindrome if it remains unchanged when reversed, for example “mam” is a palindrome as reverse of “mam” is “mam” whereas “public” is not a palindrome. Some other palindrome strings are “dad”, “madam”, “abcba”. Note: Approach to check if… Read More »

Java Lambda Expressions

Java lambda expressions are the newest and one of the best additions in Java 8. Java lambda expressions are Java’s one of the first approaches into functional programming. A Java lambda expression is thus a function which can be created without belonging to any class. A lambda expression can be passed around as if it was an object and executed on demand. Benefits of using Lambda expressions : To provide the… Read More »

Arithmetic Operation Using Lambda Expression

A lambda expression consists of the following: A comma-separated list of formal parameters enclosed in parentheses. The CheckPerson.test method contains one parameter, p, which represents an instance of thePerson class.Note: You can omit the data type of the parameters in a lambda expression. In addition, you can omit the parentheses if there is only one parameter. For example, the following lambda expression… Read More »