0% found this document useful (0 votes)
2 views2 pages

Java Library Classes and Functions Guide

Uploaded by

KNC BS
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Java Library Classes and Functions Guide

Uploaded by

KNC BS
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 2: Library Classes

1. Write a difference between the functions isUpperCase( ) and toUpperCase( ).

2. Name any two library packages.


3. Name the wrapper classes of char type and boolean type.
4. What is meant by a package ? Name any two java Application Programming
Interface packages.
5. Write one word answer for the following :
(i) A method that converts a string to a primitive integer data type.
(ii) The default initial value of a boolean variable data type.
6. Give the output of the following code :
String P = “20”, Q = “19”,
int a = Integer .parselnt(P);
int b = Integer. valueOf(Q);
[Link](a+””+b);
7. State the data type and value of res after the following is executed :
char ch = ‘9’;
res = Character. isDigit(ch) ;
8. (i) int res = ‘A’; [2]
What is the value of res ?
(ii) Name the package that contains wrapper classes.
9. State the data type and value of res after the following is executed: [2]
char ch = ‘t’;
res=Character. toUpperCase(ch);
10. Write the output:
charch= ‘F’;
int m= ch;
m=m+5;
[Link](m+ ” ” +ch);

11. char x=‘A’; int m;


m= (x==’a’) ? ‘A’: ‘a’;
[Link](“m=” +m);
12. Write the return type of the following library functions:
(i) isLetterOrDigit(char)
(ii) replace(char, char)

13. State the data type and value of y after the following is executed:
char x=7;
[Link](x);
14. State the package that contains the class :
(i) BufferedReader
(ii) Scanner
15. char ch ;
int x=97;
do
{
ch=(char) x;
[Link](ch + “ ” );
if(x%10 == 0)
break;
++x;
}while(x<=100);

16. List the variables from those given below that are composite data types: [2]
(i) static int x;
(ii) arr[i]=10;
(iii) [Link]();
(iv) boolean b;
(v) private char chr;
(vi) String str;
17. . What is the data type that the following library functions return ?
(i) isWhitespace (char ch)
(ii) [Link]()
18. State the values of n and ch.
char c=‘A’;
int n=c+1;
char ch=(char)n;
19. What is the data type returned by the following library methods? [2]
(i) isWhitespace()
(ii) compareToIgnoreCase()
20.

You might also like