Java String

Java StringBuffer Class

In this tutorial you will learn about Java StringBuffer class and its important methods with examples. StringBuffer in Java is used to create mutable strings. Here mutable means, we can modify or change the strings. StringBuffer class is thread safe which means multiple threads can’t access the same object simultaneously. Apart from StringBuffer, we can …

Java StringBuffer Class Read More »

Java String Comparison

String class in Java provides different methods for comparing strings or substrings within strings. In this tutorial I will discuss about those Java string comparison methods.   equals() and equalsIgnoreCase() We can use equals() method to check equality of two strings. It has following syntax. Syntax boolean equals(String str)   Here str is the String …

Java String Comparison Read More »

Character Extraction in Java

There are several ways by which characters can be extracted from String class object. String is treated as an object in Java so we can’t directly access the characters that comprise a string. For doing this String class provides various predefined methods.   Character Extraction in Java charAt() charAt() method is used to extract a …

Character Extraction in Java Read More »

String in Java

String in Java is a sequence of characters. In other programming languages like C and C++, string is implemented as array of characters while in Java string is implemented as object of String class. String class is defined in java.lang package. StringBuffer and StringBuilder class is also used to create string in Java. We will …

String in Java Read More »