Ajay Chaudhary Classes Pvt.
Ltd
Ajay Chaudhary Classes
Being Brilliant:-
Class 10th Computer test(Strings)
[Link] the output of the following: [2]
String s1=”phoenix”;String s2=”island”;
[Link]([Link](0).concat([Link](2)));
[Link]([Link]());
2. Write a difference between the functions isUpperCase() and toUpperCase(). [1]
3.(a) (i) int res = ‘A’;
What is the value of res?
(ii) Name the package that contains wrapper classes. [2]
4. Write the return data type of the following functions: [1]
(i) endsWith()
5. Give the output of the following string functions: [2]
(i) “ACHIEVEMENT”.replace(‘E’, ‘A’)
(ii) “DEDICATE”.compareTo(“DEVOTE”)
6. State the data type and value of res after the following is executed : [2]
char ch = ‘t’;
res = [Link](ch);
7. Give the output of the following code: [2]
String A= "26", B= "100" ;
String D=A+B+ "200";
int x= [Link](A);
int y=[Link](B);
int d=x+y;
[Link]("Result 1=" +D);
[Link]("Result 2="+d);
Computer test by:- Aman Saxena
Ajay Chaudhary Classes [Link]
8. What is the difference between the Scanner class functions next() and nextLine()? [2]
9. State the difference between == operator and equals() method. [2]
10. Give the output of the following string functions : [2]
(i) “MISSISSIPPI”.indexOf(‘S’) + “MISSISSIPPI”.lastIndexOf(‘I’)
(ii) “CABLE”.compareTo(“CADET”)
11. Write the return type of the following library functions : [2]
(i) isLetterOrDigit(char)
(ii) replace(char,char)
12. Special words are those words which starts and ends with the same letter. [15]
Examples: EXISTENCE ,COMIC, WINDOW
Palindrome words are those words which read the same from left to right and vice-versa.
Example: MALAYALAM MADAM LEVEL ROTATOR CIVIC
All palindromes are special words, but all special words are not palindromes. Write a program
to accept a word check and print whether the word is a palindrome or only special word.
Computer test by:- Aman Saxena