String : In java String is treated as immutable object that is string is predefined class. String object is created by two ways. first one is called as literal ways & by new Keyword. There are different methods is String:
- Equals() : It is used for compairing two string object value.
- == : Equal operator is used for compairing two string object reference.
- Concat() : It is used for concatinent two string.
- IndexOf() : It s used to find first occurence of a given string or character in a specific string.
- lastIndex() : It is used to find last occurence of a given string or character in a given specific string.
- startWith() : It is used to find out string is strt or not with a specific string of character.
- endWith() : It is used to find out given string or character is end or not.
- CharAt() : It is used to find out character from a given Index.
- length(): It is used to find out the length of a string.
- toCharArray() : It is used to convert string object value into character Array.
- replace() : It is used to replace given character to specific character.
- toLowerCase : It is used to convert string into Lower case.
- toUpperCase : It is used toc onvert String into Upper case.
String Buffer : String Buffer is a predefined class of java application. String Buffer is treated as mutable object. There are different methods in String buffer :
- append() : It is used to concat two string.
- reverse() : It is used a given string buffer.
- toString() : It is used to convert mutable object into immutable object that is to string method used to convert string buffer value object into string object.