In this tutorial, we will learn how to find duplicate elements in an array of strings. We will learn this using two different approaches :.
ReadIn this tutorial, we will learn how to print the count of each word in a string using Java. The user will first enter the string and then we will find the count and print out the result.
ReadIn this tutorial, we will learn how to count the occurrence of each character in a String. The user will enter one string and we will count the occurrence of each character in that string. We will use one HashMap to store the character and count for that character. The key of that hash map is Character and value is Integer. Let's take a look at the Java program first :.
ReadIn this tutorial, we will learn how to read strings from a file, how to modify the contents and then again write them back in the same file. We are not taking any inputs from the user. In this example, after reading the contents of the file, we are replacing all 'new' words with 'old'. For example, if the file contain one string This is a new ball., after modification it will become This is a old ball. Let's take a look into the program before moving into more details :.
ReadIn this example, we will learn how to convert a string to boolean value. For that, we will use one static method valueOf(String) of the Boolean class. This class is defined as below :.
ReadIn this tutorial, we will learn how to capitalize first letter of each word in a string in Java. User will input one string and then we will capitalize first letter of each word and modify and save the string in a different String variable. Finally, we will output the String.
ReadIn this example, we will learn how to use ListIterator in Java . ListIterator is an interface that extends Iterator interface. Using it, we can iterate a list in either direction. During the iteration, we can get the current position of the iterator and the value of the current element.
ReadIn this tutorial, we will learn how to remove all blank characters (like whitespace,tabs,newline etc) from a string. We will learn two different methods to achieve this.
ReadIn this tutorial, we will learn how to find the sum of all digits of a number in Java. Algorithm we are using is as below :.
ReadIn this tutorial, we will learn how to find the area and perimeter of a rectangle. To find the area and perimeter, we need only height and width of the rectangle. Area of a rectangle is 'height * width' and perimeter is ' 2* ( height + width )' .
Read