19. Write the output of the following program
class Fullprog
{
public static void inputstring(String name)
{
System.out.println("The Entered string is”+name);
System.out.println("the uppercase is"+name.toUpperCase());
System.out.println("the lowercase is"+name to LowerCase());
System.out.println("the length of a string is"+name.length());
System.out.println("the trim is"+name.trim());
}
}
OUTPUT:
The Entered string is i Love my country
Answers
Answered by
5
Answer:
The Entered string is i Love my country
the uppercase is I LOVE MY COUNTRY
the lowercase is i love my country
the length of a string is 17
the trim is i Love my country
Explanation:
toUpperCase() will convert all the characters into UPPERCASE.
toLowerCase() will convert all the characters into lowercase.
length() will give length of the string including spaces.
trim() will remove the spaces which in the starting and ending of the string.
Similar questions