Pageviews

Sunday 16 June 2013

toUpperCase() and toLowerCase() in Java

by Unknown  |  in Strings at  Sunday, June 16, 2013

Java supports a good functionality to its developers,Java allows us to convert our Characters to Upper case and Lowercase as we require.These functions helps a lot in projects,where users enters the information.

1.toUpperCase(): This function converts the given characters to Upper case 

Syntax: Stringname.toUpperCase();

2.toLowerCase(): This function converts the given characters to Lower case 

Syntax: Stringname.toLowerCase();

WAP to show the use of toUpperCase() and toLowerCase() functions in Java:

class Sop
{
public static void main(String args[])
{
char ch[]={'k','o','d','i','n','g'};
String s1="Kodingpoint";
String s2="KODINGPOINT";
System.out.println(s1);
String s3=new String(s1);
System.out.println(ch);
System.out.println(s1.toUpperCase());
System.out.println(s2.toLowerCase());
}

}

The output goes here:


Strings

0 comments:

Proudly Powered by Blogger.