StringBuilder

StringBuilder is very similar to StringBuffer except for one important difference which is not synchronized. It means StringBuilder is not thread safe as methods inside StringBuilder class are not synchronised. StringBuilder is also mutable like StringBuffer. Mutable string means we can modify the string as many times as we want without creating a new string […]

Share this article on

isEmpty, startswith and endsWith

isEmpty This method is used to check whether string has any characters in it or its empty string. It returns true if length of a string is zero and false otherwise. Method signature public boolean isEmpty() public boolean isEmpty() Example public class StringEmptyExample{   public static void main(String args[]){   String s1="";   String s2="java"; […]

Share this article on
< Previous Next >