Using Java Remove White Spaces From String In Java Using Built-In Methods? we use replaceAll() method of String class to remove all white spaces (including tab also) from a string. This is one of the easiest method to remove spaces from string in java. replaceAll() method takes two parameters. One is the string to be replaced and another one is the …
Continue reading White Spaces Removal ProgramPrograms
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 ArrayListUsing 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 Number