Java toUpperCase() Method

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

Java toUpperCase() Method In Java

In this section you will learn about how to use toUpperCase() in Java. From the name of the method you can also know what this function does?, this function is of String class convert the string into upper case

Syntax :

public String toUpperCase()

Return Value :

It return the string in upper case.

Here str is String object, which contain the string to convert in uppercase. toUpperCase() method is of string class.

Description of code : Here is the example using toUpperCase() method  to convert to upper case in java. First we declare a class named "". In that class we have declared one String object and initialize it with the string "rose india" and passing that string to println() method. Then uppercase() method will return the string in Upper case as "ROSE INDIA".

public class Touppercase {
	public static void main(String args[])
		String str="rose india";

Output from the program

Download Source Code

Share on Google+Share on Google+

Java toUpperCase() Method

Posted on: July 5, 2013 If you enjoyed this post then why not add us on Google+? Add us to your Circles



Discuss: Java toUpperCase() Method In Java  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image