Using Java In this method, we use HashSet to remove duplicate elements from an ArrayList. As you know, HashSet doesn’t allow duplicate elements. We use this property of HashSet to remove duplicate elements from already constructed ArrayList. But, there is one disadvantage of this method. That is, it erases the insertion order of ArrayList elements. That means, …
Continue reading How To Remove Duplicate Elements From ArrayListJava Program
Using Java Split the given inputString into words using split() method. Then take each individual word, reverse it and append to reverseString. Finally print reverseString. Below image shows code snippet of the same.
Continue reading How To Reverse Each Word Of A StringFibonacci Series The Fibonacci series is a series where the next term is the sum of the previous two terms. The first two terms of the Fibonacci sequence are 0 followed by 1 Program to print fibonacci series using for loop Fibonacci series up to a given number (instead of terms)
Continue reading Program to Display Fibonacci SeriesUsing Java Find Factorial of a number using for loop
Continue reading Program to Find Factorial of a NumberUsing Java Check whether a number is even or odd using if…else statement Check whether a number is even or odd using ternary operator
Continue reading Program to Check Whether a Number is Even or Odd