The toUpperCase() Method:
This method converts all lower and Upper case characters of the invoking String to upper case.
The general form is:
String toUpperCase();
Consider the following Example:
ToUpperCaseTest.java
class ToUpperCaseTest
{
public static void main(String arg[])
{
String str=" Hello Java";
System.out.println("Before toUpperCase():"+str);
System.out.println("After toUpperCase():"+str.toUpperCase());
}
}
The output generated by the following program is:
Before toLowerCase():hello java
After toLowerCase():HELLO JAVA
Next Topic Shahbaz
0 comments:
Post a Comment