The method toLowerCase( ) converts all the characters in a string from uppercase to lowercase. The toUpperCase( ) method converts all the characters in a string from lowercase to uppercase.
The method toLowerCase( ) converts all the characters in a string from uppercase to lowercase. The toUpperCase( ) method converts all the characters in a string from lowercase to uppercase.
These two methods are overloaded in several different ways. In all cases, the methods return the index at which the character or substring was found, or –1 on failure.
== : is a reference comparison ie both objects point to the same memory location
equals() : evaluates to the comparison of values in the objects
Example show use of getChars (). Copies characters from this string into the destination character array.
toString() method in Java is used to provide clear and concise information about Object in human readable format.
Example shows how to use string concatenation (+ can be used)to prevent long lines.
Example shows how to construct a new String by decoding the specified array of bytes using the platform's default charset.
String 's2' :
Parameters: