0% found this document useful (0 votes)
36 views

Class 10 Library classes Important Questions

The document contains important questions for Class 10 related to library classes and data types in Java, including multiple-choice questions and short answer questions. Topics covered include memory allocation for class objects, wrapper classes, primitive and composite data types, and various methods for data conversion. Additionally, it includes assignment questions that explore the definitions and uses of library classes, primitive types, and concepts like autoboxing and auto-unboxing.

Uploaded by

asitakumar25
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)
36 views

Class 10 Library classes Important Questions

The document contains important questions for Class 10 related to library classes and data types in Java, including multiple-choice questions and short answer questions. Topics covered include memory allocation for class objects, wrapper classes, primitive and composite data types, and various methods for data conversion. Additionally, it includes assignment questions that explore the definitions and uses of library classes, primitive types, and concepts like autoboxing and auto-unboxing.

Uploaded by

asitakumar25
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
You are on page 1/ 5

Class 10 Library classes Important Questions

Q1. Memory is allocated for class objects when

Options

(a) Class is defined


(b) Function is called
(c) Both (a) and (b)
(d) Object is created

Q2. The process of converting wrapper class object to primitive data


type is called :

Options

(a) Boxing
(b) Unboxing
(c) Conversion
(d) Post Boxing

Q3. Name a method to convert a value to string ? Give an example.

4) Which of the following is a primitive data type?


1. int
2. float
3. char
4. All of these
5) Which of the following is a composite data type?
1. int
2. float
3. char
4. String
6) The return type of the isLowerCase() method is ............... .
1. int
2. boolean
3. char
4. String
7) The return type of the toLowerCase() method is ............... .
1. int
2. boolean
3. char
4. String
8) The value returned by Integer.parseInt("-321") is ............... .
1. -321
2. 321
3. 321.0
4. "321"
9) Name the method that can convert a string into its integer equivalent.
1. Integer.parseInteger()
2. Integer.getInt()
3. Integer.parseInt()
4. Integer.readInt()
10) What will be the result when the following statement is executed?
int count = new Integer(12);
1. Variable count will be initialised with value 12.
2. Variable count will be initialised with default value of int, i.e., zero
(0).
3. An array count will be initialised with 12 elements, all having a
default value of zero (0).
4. Value of count will be unknown as no value has been assigned
yet.
11) In which package is the wrapper class Integer available?
1. java.io
2. java.util
3. java.awt
4. java.lang

12) state the data and value of y after the following is executed:
Char X = ‘7’;
Y = Character.isLetter(x);

. 13) Write the output of the following program code:


Char ch;
int x = 97;
do
{
Ch = (char) x;
System.out.println (ch + “ “);
if(x% 10== 0)
Break;
++x;
}
while (x <= 100);

14) what will be the output when the following code segments are
executed?
(i) String s = “1001”;
int x=Integer.valueOf(s);
Double y = Double.valueOf(s);
System.out.println(“x=”+x);
System.out.println(“y=”+y);
(ii) system.out.println(“The King said\”Begin at the beginning!\”to me”);
15) Name any two wrapper classes.
16) Name the wrapper classes of char type and boolean type.
17) State the package that contains the class:
(i) BufferedReader (ii) scanner

18) What is the data type that the following library functions return?
(i) isWhiteSpace(char ch)
(ii) Math.random( )

19) State the value of n and ch.


Char c=’A’;
int n=c+1;
char ch=(char)n;

20) state the method that:


(i) converts a string to a primitive float data type. (ii)determines if the
specified character is an upper case character.

21) what are library classes? Give an example.

22) Write a function to check whether a character is a blank or not.


Assignment Questions
Question 1
What are the library classes in Java? What is their use?
Question 2
Define Primitive data type
Question 3
Define Composite data type
Question 4
Define User-defined data type
Question 5
Why is a class called a composite data type? Explain.
Question 6
What is a wrapper class? Name three wrapper classes in Java.
Question 7
Explain the terms, Autoboxing and Auto-unboxing in Java.
Question 8
How do you convert a numeric string into a double value?
Question 9
How can you check if a given character is a digit, a letter or a space?
Question 10
Distinguish between isLowerCase() and toLowerCase()
Question 11
Distinguish between isUpperCase() and toUpperCase()
Distinguish between isDigit() and isLetter()
Distinguish between parseFloat() and parseDouble()

You might also like