Computer Science, asked by asharajwade033, 7 months ago

Differentiate between toLowerCase() and

toUpperCase() methods.​

Answers

Answered by kshi039814
2

Answer:

lower case is the small aplhabets like in 1 i am typing wheras uper case is A capital letters

pls mark me as brainlist

Explanation:

Answered by Anonymous
1

Answer:

Guru99

Java String toLowercase() and toUpperCase() Methods

1. tolowercase() method

This Java string method converts every character of the particular string into the lower case by using the rules of the default locale.

Note: This method is locale sensitive. Therefore it can show unexpected results if used for strings which are intended to be interpreted separately.

Syntax

public String toLowerCase()

Parameters

NA

Return Value

It returns the String, which is converted to lowercase.

Example 1:

public class Guru99 {

public static void main(String args[]) {

String S1 = new String("UPPERCASE CONVERTED TO LOWERCASE");

//Convert to LowerCase

System.out.println(S1.toLowerCase());

}

}

Output:uppercase converted to lowercase

2. toUppercase () method

The toUppercase() method is used to convert all the characters in a given string to upper case.

Syntax:

toUpperCase()

Parameters:

NA

Returns value:

String in an uppercase letter.

Example 2:

public class Guru99 {

public static void main(String args[]) {

String S1 = new String("lowercase converted to uppercase");

//Convert to UpperCase

System.out.println(S1.toUpperCase());

}

}

Output:

LOWERCASE CONVERTED TO UPPERCASE

Hope this will helps u.....be happy......

Similar questions