You are here: Home / Topics / toUpperCase() method example in Java

toUpperCase() method example in Java

Filed under: Java on 2023-08-23 18:51:59

// Program to explain the following String function :
// String toUpperCase()

class  MtoUpperCase
{
public static void main( String args[ ] )
{
 String s1 = "Java Programming Examples";
 String s2 = s1.toUpperCase();

 System.out.println( " Original  String : " + s1 );
 System.out.println( " UpperCase String : " + s2 );
}
}


Output:

 Original  String : Java Programming Examples
 UpperCase String : JAVA PROGRAMMING EXAMPLES

About Author:
J
Java     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.