You are on page 1of 2

Ajay Chaudhary Classes Pvt.

Ltd

Ajay Chaudhary Classes


Being Brilliant:-
Class 10th Computer test(Strings)

1.Write the output of the following: [2]


String s1=”phoenix”;String s2=”island”;
System.out.println(s1.substring(0).concat(s2.substring(2)));
System.out.println(s2.toUpperCase());

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 = Character.toUpperCase(ch);

7.  Give the output of the following code: [2]

String A= "26", B= "100" ;

String D=A+B+ "200";

int x= Integer.parseInt(A);

int y=Integer.parseInt(B);

int d=x+y;

System.out.println("Result 1=" +D);

System.out.println("Result 2="+d);

Computer test by:- Aman Saxena


Ajay Chaudhary Classes Pvt.Ltd

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

You might also like