Sum of elements of Linked List using Iterator : In this program, we are inserting elements in a Linked List. And, then traversing the list using an iterator, the goal is to find sum of all the elements of the list. Output [4.3, 2.2, 3.5, 5.0] [4.3, 2.2, 3.5] Sum Of Numbers:10.0
This is a program in Java to print all the sub strings of a input string. Example : The list of all substrings of the string “apple” would be “apple“, “appl“, “pple“, “app“, “ppl“, “ple“, “ap“, “pp“, “pl“, “le“, “a“, “p“, “l“, “e“, “”.
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 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 »
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 »