Home Java Beginners toUpperCase() Method In Java
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

toUpperCase() Method In Java

Advertisement
In this section, you will learn how to use toUpperCase() method of the String class.

toUpperCase() Method In Java

     

In this section, you will learn how to use toUpperCase() method of the String class. We are going for using toUpperCase() method. This method is explained as follows:

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 roseindia = "india";
  System.out.println("String is : " + roseindia);
  String upper = roseindia.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

C:\java_work>

Download this Example.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 5, 2007

Ask Questions?    Discuss: toUpperCase() Method In Java   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
carl
December 24, 2011
about the java statement

can u teach me how to use java programming?
DMCA.com