Java : Lambda Expression - Exercises and Solution

1. Write a Java program using Lambda Expression to find the sum of two integers

View Solution

2. Write a Java program using Lambda Expression to convert a list of strings to uppercase and lowercase

View Solution

3. Write a Java program using Lambda Expression to filter out even numbers from a list of integers

View Solution

4. Write a Java program using Lambda Expression to filter out odd numbers from a list of integers

View Solution

5. Write a Java program using Lambda Expression to check if a given string is empty

View Solution

6. Write a Java program using Lambda Expression to find the average of a list of doubles

View Solution

7. Write a Java program using Lambda Expression to remove duplicates from a list of integers

View Solution

8. Write a Java program using Lambda Expression to sort a list of strings in alphabetical order

View Solution

9. Write a Java program using Lambda Expression to calculate the sum of all Even numbers

View Solution

10. Write a Java program using Lambda Expression to calculate the sum of all Odd numbers

View Solution

11. Write a Java program using Lambda Expression to calculate the factorial of a given number

View Solution

12. Write a Java program using Lambda Expression to concatenate two strings

View Solution

13. Write a Java program using Lambda Expression to find the maximum values in a list of integers

View Solution

14. Write a Java program using Lambda Expression to find the minimum values in a list of integers

View Solution

15. Write a Java program using Lambda Expression to multiply and sum all elements in a list of integers

View Solution

16. Write a Java program using Lambda Expression that takes a list of numbers and returns the square of each number

View Solution

17. Write a Java program using Lambda Expression to check if a given string is a palindrome (reads the same backward as forward), ignoring spaces and case

View Solution

18. write a Java program using Lambda Expression to sort the strings based on their lengths in ascending order

View Solution

19. Write a Java program using Lambda Expression to find the maximum string in a list of strings

View Solution

20. Write a Java program using Lambda Expression to find the minimum string in a list of strings

View Solution

21. Write a Java program using Lambda Expression to convert a list of strings to uppercase

View Solution

22. Write a Java program using Lambda Expression to filter out all strings from a list that have a length greater than 5 characters

View Solution

23. Write a Java program using Lambda Expression to convert a list of integers to their corresponding binary strings

View Solution

24. Write a Java program using Lambda Expression to find the prime numbers in a list of integers

View Solution

25. Write a Java program using Lambda Expression to count the number of words in a given sentence (words are separated by spaces)

View Solution

26. Write a Java program using Lambda Expression to convert a list of strings to uppercase if the string length is even and to lowercase if the string length is odd

View Solution

27. Write a Java program using Lambda Expression to find the square of each odd number in a list of integers

View Solution

28. Write a Java program using Lambda Expression to calculate the sum of all prime numbers in a list of integers

View Solution

29. Write a Java program using Lambda Expression to remove the vowels from a list of strings

View Solution

30. Write a Java program using Lambda Expression to calculate the product of all even numbers in a list of integers

View Solution

31. Write a Java program using Lambda Expression to find the sum of squares of all numbers from 1 to 10

View Solution

32. Write a Java program using Lambda Expression to find the difference between the maximum and minimum values in a list of doubles

View Solution

33. Write a Java program using Lambda Expression to find the number of words that start with a vowel in a list of strings

View Solution

34. Write a Java program using Lambda Expression to find the sum of squares of even numbers in a list of integers

View Solution

35. Write a Java program using Lambda Expression to find the product of all odd numbers in a list of integers

View Solution

36. Write a Java program using Lambda Expression to find the first non-empty string in a list of strings

View Solution

37. Write a Java program using Lambda Expression to find the longest palindrome string in a list of strings

View Solution

38. Write a Java program using Lambda Expression to find the sum of all positive integers in a list of numbers

View Solution

39. Write a Java program using Lambda Expression to check if all strings in a list start with an uppercase letter

View Solution

40. Write a Java program using Lambda Expression to find the square root of each number in a list of doubles

View Solution

41. Write a Java program using Lambda Expression to find the largest even number in a list of integers

View Solution

42. Write a Java program using Lambda Expression to find the second largest number in a list of integers

View Solution

43. Write a Java program using Lambda Expression to check if all strings in a list start with the letter 'S'

View Solution

44. Write a Java program using Lambda Expression to find the sum of squares of odd numbers in a list of integers

View Solution

45. Write a Java program using Lambda Expression to find the smallest palindrome string in a list of strings

View Solution