Search Java Programs

Wednesday, January 20, 2010

toUpperCase() Method In Java

Description of program:

Here, you will see the procedure of converting letters of the string in uppercase letter. So, we are using toUpperCase() method of the String class for the purpose.

The following program convert the string "india" into "INDIA" by using toUpperCase() method.

toUpperCase(): This method returns a string value.

Here is the code of this program:

public class ConvertInUpperCase{
public static void main(String args[]){
String javasefx = "india";
System.out.println("String is : " + javasefx);
String upper = javasefx.toUpperCase();
System.out.println("String in uppercase letter: " + upper);
}
}

Output of program:
C:\java_work>javac ConvertInUpperCase.java

C:\java_work>java ConvertInUpperCase
String is : india
String in uppercase letter: INDIA

No comments:

Post a Comment

Website Design by Mayuri Multimedia