Java Practice Ques
Java Practice Ques
Given a list of integers, write a Java 8 program to separate the odd and even
numbers into two separate lists.
Write a Java 8 program to remove duplicate elements from a list using the stream
API and lambda expressions.
Write a Java 8 program to find the frequency of each character in a given string
using the stream API and collectors.
Write a Java 8 program to find the frequency of each element in an array or a list
using streams and collectors.
Write a Java 8 program to sort a given list of decimal numbers in reverse order.
Join a list of strings with '[' as prefix, ']' as suffix, and ',' as delimiter
Given a list of strings, write a Java 8 program to join the strings with '[' as a
prefix, ']' as a suffix, and ',' as a delimiter.
Print the numbers from a given list of integers that are multiples of 5
Write a Java 8 program to print the numbers from a given list of integers that are
multiples of 5.
Given a list of integers, write a Java 8 program to find the maximum and minimum
numbers in the list.
Merge two unsorted arrays into a single sorted array using Java 8 streams
Write a Java 8 program to merge two unsorted arrays into a single sorted array
using the stream API.
Merge two unsorted arrays into a single sorted array without duplicates
Write a Java 8 program to merge two unsorted arrays into a single sorted array
without duplicates.
Get the three maximum and three minimum numbers from a given list of integers
Write a Java 8 program to get the three maximum and three minimum numbers from a
given list of integers.
Write a Java 8 program to check if two strings are anagrams or not using the stream
API and lambda expressions.
Find the sum of all digits of a number in Java 8
Write a Java 8 program to find the sum of all digits of a given number.
Write a Java 8 program to find the second largest number in an integer array.
Write a Java 8 program to sort a given list of strings according to the increasing
order of their length.
Write a Java 8 program to find the sum and average of all elements in an integer
array.
Write a Java 8 program to find the common elements between two arrays using
streams.
Write a Java 8 program to reverse each word of a given string using the stream API
and lambda expressions.
Write a Java 8 program to find the sum of the first 10 natural numbers using
streams.
Write a Java 8 program to check if a given string is a palindrome using the stream
API and lambda expressions.
Given a list of strings, write a Java 8 program to find the strings that start with
a number.
Write a Java 8 program to calculate the age of a person in years given their
birthday.