String-Manipulations_output2020
String-Manipulations_output2020
String Manipulations
1
9. String wd1="Computer"+"Science"+"1"+"2";
String wd2="Arya Publishing Company";
System.out.println(wd1);
System.out.println(wd2);
Ans: ComputerScience12
Arya Publishing Company
10. String str1="Super Power";
String str2="India";
System.out.println (str1+str2);
System.out.println (str1.length ());
System.out.println(str1.charAt(5));
System.out.println(str1.equals(str2));
Ans: Super PowerIndia
11
False
11. String str=new String("Super computer");
System.out.println(str.toUpperCase());
System.out.println(str.substring(5));
System.out.println(str.substring(5,10));
Ans: SUPER COMPUTER
computer
comp
12. String str="cOmPutER";
for(int a=0;a<str.length();a++)
{
System.out.println(Character.isLowerCase(str.charAt(a)));
}
Ans:
True
False
True
2
False
True
True
False
False