Featured Article

Count of distinct substrings of a string using Suffix Trie

Given a string of length n of lowercase alphabet characters, we need to count total number of distinct substrings of this string. Examples: Input : str = “ababa” Output : 10 Total number of distinct substring are 10, which are, “”, “a”, “b”, “ab”, “ba”, “aba”, “bab”, “abab”, “baba” and “ababa” The idea is create… Read More »

java.lang.Character class – methods | Set 2

java.lang.Character class – methods | Set 1 Following methods of Character class are discussed here : toUpperCase() : java.lang.toUpperCase(char arg) method converts given character in argument to its Upper case based on Unicode values. Syntax : public static char toUpperCase(char arg) Parameters : arg : character to be converted to Upper case Return : Upper… Read More »

Constructor Chaining In Java with Examples

Constructor chaining is the process of calling one constructor from another constructor with respect to current object. Constructor chaining can be done in two ways: Within same class: It can be done using this() keyword for constructors in same class From base class: by using super() keyword to call constructor from the base class. Constructor… Read More »