1. Introduction In this article we will count occurrences of substring in input string. Below is an exmaple. 2. So, how to write a code […]
Difference between Hashtable and HashMap
Below is the difference between Hashtable and HashMap: In terms of Null keys and Null values Hashtable does not allows null keys or values. If […]
Count frequency of all characters in String
1. Introduction In this String relation interview question, we are supposed to find the frequency of every character in String. For example: Input Output “” […]
Check if two strings are anagram
1. Introduction Two strings are anagram of each other if all the characters of one string matches another string’s characters. 2. Different ways to check […]
3 different ways to find the first non-repeating character in word
1. Introduction In this article we will see how to search for first non-repeating character in the word. 2. Different ways to search for first […]
7 different ways to Traverse Map
1. Introduction In this article, I will show you how to traverse the Map in 7 different ways. Map is an interface that stores key-value […]
Java code to Generate Fibonacci Series.
Embed from Getty Images Fibonacci Series: Fibonacci series is a series of numbers which are built up based on previous numbers. Example: f(1) – The […]
How to use join method of String class?
1. Introduction In this article, we will go through the new methods added in String class in Java 8 under package java.lang. A little about […]