Java Technology - 2018 - String
String is basically an object that represents sequence of char values. An array of characters works same as java string. char[] ch = {'m','a','n'}; String str = new String(ch); The java.lang.String class implements Serializable , Comparable and CharSequence interfaces. The CharSequence interface is used to represent sequence of characters The java String is immutable i.e. it cannot be changed. Whenever we change any string, a new instance is created. For mutable string, you can use StringBuffer and StringBuilder classes. Generally, string is a sequence of characters. But in java, string is an object that represents a sequence of characters. The java.lang.String class is used to create string object. How to create String object? There are two ways to create String object: By string literal By new keyword String str = "everest"; ava String literal is created by using double quotes. For Example: String s=...