. . . . . . . . is used to converting a string to uppercase.

toUpper
toLower
toUpperCase
toLowerCase

The correct answer is C. toUpperCase().

The toUpperCase() method is used to convert a string to uppercase. It takes a string as input and returns a new string with all of the characters in the original string converted to uppercase.

The toUpper() method is used to convert a character to uppercase. It takes a character as input and returns a new character with the same value as the original character, but in uppercase.

The toLower() method is used to convert a character to lowercase. It takes a character as input and returns a new character with the same value as the original character, but in lowercase.

The toLowerCase() method is used to convert a string to lowercase. It takes a string as input and returns a new string with all of the characters in the original string converted to lowercase.

Here is an example of how to use the toUpperCase() method:

String str = "Hello, World!";
String upperStr = str.toUpperCase();
System.out.println(upperStr); // prints "HELLO, WORLD!"

Here is an example of how to use the toUpper() method:

char ch = 'a';
char upperCh = ch.toUpperCase();
System.out.println(upperCh); // prints "A"

Here is an example of how to use the toLower() method:

char ch = 'A';
char lowerCh = ch.toLowerCase();
System.out.println(lowerCh); // prints "a"

Here is an example of how to use the toLowerCase() method:

String str = "Hello, World!";
String lowerStr = str.toLowerCase();
System.out.println(lowerStr); // prints "hello, world!"

Exit mobile version