Top Posts in Python
Java String compareTo()
Java String compareTo() method is used to compare two strings lexicographically. This method is declared in Comparable interface. Since String implements Comparable interface, it provides compareTo() method implementation. Java String compareTo Java String class has….
Java String substring() Method Examples
Java String substring() method returns the substring of this string. This method always returns a new string and the original string remains unchanged because String is immutable in Java. Java String substring() Methods Java String….
Why String is Immutable in Java?
Why String is immutable in Java is one of the popular interview questions. The string is one of the most used classes in any programming language. We know that String is immutable and final in….
What is Java String Pool?
As the name suggests, String Pool in java is a pool of Strings stored in Java Heap Memory. We know that String is a special class in java and we can create String objects using….
String to char array java – convert string to char
Sometimes we have to convert String to the character array in java programs or convert a string to char from specific index. String to char Java String class has three methods related to char. Let’s….
Java String split
Java String split() method is used to split the string into a string array based on the provided regular expression. Java String split Sometimes we have to split String in Java, for example splitting data….
How to Sort a List in Java
Sometimes we have to sort a list in Java before processing its elements. In this tutorial, we will learn how to sort a list in the natural order. We will also learn how to use….
How to Sort an Array in Java
Java Array is like a container that can hold a fixed number of the same type of items, it can be primitive types as well as Objects. Array Sorting in Java Sometimes we need to….
Comparable and Comparator in Java Example
Comparable and Comparator in Java are very useful for sorting the collection of objects. Java provides some inbuilt methods to sort primitive types array or Wrapper classes array or list. Here we will first learn….
How to Convert String to Array in Java
Sometimes we have to split String to array based on delimiters or some regular expression. For example, reading a CSV file line and parsing them to get all the data to a String array. In….