ICSE Class 10 Computer Applications Chapter 07 Using Library Classes Notes and Important Questions with Answers

Revision Notes for Class 10 Computer Applications: Chapter 07 Using Library Classes

Review targeted revision notes for Class 10 Computer Applications with the ICSE Class 10 Computer Applications Chapter 07 Using Library Classes Notes and Important Questions with Answers. Built according to official educational guidelines for the 2026-27 academic year, these downloadable summaries for Chapter 07 Using Library Classes support daily study and last-minute exam readiness.

Review Chapter 07 Using Library Classes for Class 10 Computer Applications

View or download the dedicated Chapter 07 Using Library Classes revision resource below. Engaging with these structured concept notes daily ensures continuous academic progress and mastery of the 2026-27 curriculum for Computer Applications.

These ICSE Class 10 Computer Applications notes on Using Library Classes cover key terms with 25 solved questions. They explain packages and import, BufferedReader input, string methods with index examples, the Math class and exception handling, with programs for string handling and pattern printing.

Important Terms and Definitions

1. For input/output, System.in and System.out objects are drawn from the System class.

2. The Reader, Input and Data objects are to be defined in the program.

3. The flow of data entered as input is as shown below: Keyboard System.in Reader Input Data Object System.out Screen

4. The three classes which are involved in the input process are
(i) IOException, (ii) InputStreamReader and (iii) BufferedReader

5. The following statement will allow access to these classes: import java.io.*;

6. The asterisk indicates that entire package should be available.

7. The object reader is an instance of the InputStreamReader class. It acts as pipeline to convey data from keyboard to the stream for onward transmission into the program.

8. The object input is an instance of the BufferedReader class.

9. The input object is tied up with the reader object.

10. The input object extracts input item.

11. Using readLine ( ) method of the BufferedReader class, the input object can accept an entire line of characters entered through the keyboard, which is delivered as a string object.

12. The following steps may be noted:
InputStreamReader indata = new InputStreamReader (System.in);
BufferedReader input = new BufferedReader (indata);
String studentName = input.readLine ( );

13. The print ( ) and println ( ) methods are useful in displaying the output on the computer screen.

14. The 'throws IOException' clause allows the use of the readLine ( ) method.

15. studentName = input.readLine ( );
The above statement allows to copy a line of characters entered through keyboard till the new line character '\n'. Here, studentName is a string.

16. For input of values during program execution, the parse command of the wrapper class may be used.
e.g. int N = Integer.parseInt (s); // s is a string etc.

17. Another form of input is using the KeyboardReader class.
e.g.
int i = KeyboardReader.readInt ( ); // To read an integer
double j = KeyboardReader.readDouble ( ); // To read a double
String s = KeyboardReader.readString ( ); // To read a string

18. In KeyboardReader class
(i) all methods are static,
(ii) they may be invoked using the class name,
(iii) there is no need to create keyboard object.

19. String is a class.

20. The string access methods frequently required are listed below:
(i) char charAt (int i): finds the character in the ith index (counting i = 0 for the first position).
Example:
Str = "We know what we are, but know not what we may be"
Index position:
01234567891011121314151617181920212223
We know what we are, but
242526272829303132333435363738394041424344454647
 know not what we may be
Str.charAt (0) = 'W'
Str.charAt (1) = 'e'
Str.charAt (7) = ' ' (a blank space)
Str.charAt (36) = 'a'
(ii) int compareTo (String str1, String str2): Compares two strings as per their occurrence in the dictionary. Returns < 0 or = 0 or > 0 according as str1 is numerically less or equal or greater than that of str2.
(iii) String concat (String str): concatenates the specified string at the end of the current string object. This is same as str1 + str2.
(iv) boolean endsWith (String str): Finds whether the current string object ends with specified string str.
(v) boolean equals (String str): Compares two strings scrutinising case difference and returns true if the strings are identical including cases. Otherwise returns false.
If str1 = "Dog", str2 = "Dog" and str3 = "dog",
str1.equals (str2) returns true;
str2.equals (str3) returns false;
(vi) boolean equalsIgnoreCase (String str): Equality of strings are decided ignoring cases.
For example, when str1 = "Dog"; str2 = "Dog", and str3 = "dog", then
str1.equalsIgnoreCase (str2)
str2.equalsIgnoreCase (str3)
and str3.equalsIgnoreCase (str1)
will all return true.
(vii) int indexOf (char ch): Finds the position number of the first occurrence of a character in the string.
For example, considering the string str of (i),
Str.indexOf ('W') = 0
Str.indexOf (' ') = 2
Str.indexOf ('u') = 22
Str.indexOf ('v') = -1 // character not found
indexOf (char, int): Finds the first occurrence of a specified character from the specified index in int (from which search should begin).
In the str of example (i) str.indexOf ('w', 10) = 13
(viii) int lastIndexOf (char ch): Finds the character in its last occurrence.
In the str of (i), str.lastIndexOf ('e') = 47 and str.lastIndexOf ('b') = 46
(ix) int length ( ): Returns the length of the current string object. str.length ( ) = 48 for str of (i).
(x) String replace (char oldChar, char newChar): Replaces old char (1st parameter) by the new char (second parameter) in all occurrences.
Example: String str = "Conference Maketh a ready Man"; str.replace ('M', 'm') would replace string str by "Conference maketh a ready man".
However, this replacement is temporary. The original str remains unaffected.
(xi) boolean startsWith (String str): Checks whether the current string object starts with the specified str. Returns true or false.
(xii) String substring (int beginIndex, int endIndex): Extracts a substring from a given string from the starting specified to the one before the specified end index.
Example: If string str = "An exact man", then
str.substring (3, 7) = "exac"
and str.substring (9, 12) = "man"
String toLowerCase ( ): Converts all the characters of the current string object (this) to lower case.
(xiii) String toUpperCase ( ): Converts all the characters of the current string object to upper case.
(xiv) String trim ( ): Removes white spaces from both ends of current string.
(xv) String valueOf (all types): Returns string represented by the value of the passed parameter.
For example: valueOf (27) is returned as string "27".
21. Mathematical Library Functions:
Sl.No.FunctionDescriptionExample
(i)pow (x, y)Returns the (double) value of \( x^y \)pow (2, 5) = 32.0
(ii)log (x)Returns the (double) value of log of x w.r.t. natural base e.log (3) = 1.0986...
(iii)sqrt (x)Returns (double) value of positive square root of x.sqrt (5) = 2.2360679...
(iv)ceil (x)Returns after rounding up the smallest integer greater than or equal to x.ceil (32.85) = 33.0
ceil (32.17) = 33.0
(v)floor (x)Returns the rounded down nearest integer less than or equal to x.floor (27.92) = 27.0
floor (27.29) = 27.0
(vi)rint (x)Returns x rounded to integral value (nearest integer value)rint (27.92) = 28.0
rint (27.29) = 27.0
(vii)abs (a)Returns absolute value of a numeric data typeabs (-5.69) = 5.69
abs (15.12) = 15.12
(viii)max (a, b)Returns the larger of a and bmax (9, 5) = 9
max (5, 9) = 9
(ix)min (a, b)Returns the smaller of a and bmin (4, 8) = 4
min (8, 4) = 4
(x)random ( )r = Math.random ( ) returns a random real number r, such that 0 ≤ r < 1
(xi)sin (x)Returns the sin of x radiansin (pi/6) = 0.5
(xii)cos (x)Returns the cos of x radiancos (pi/4) = 0.7071...
(xiii)tan (x)Returns the tan of x radiantan (pi/3) = 1.7320...

22. Java has a library of pre-written classes, divided into groups known as packages. Some very commonly used packages are the following:
(i) java.io .... This is the java input/output package.
(ii) java.lang .... Java language package.
(iii) java.util .... Java utility package.

23. Packages with their classes and interfaces are imported in a program by using the import command. This permits the use of classes, methods etc. of a package in the associated program.

24. All import statements (one or more) should be written at outset.

25. Every Java program has java.lang package automatically imported by the runtime system.

26. The instance of a character class can hold only single character data.

27. The instance of a string class can hold immutable or unchanging string whose initial value cannot be modified.

28. The instance of a StringBuffer class can hold mutable or alterable string data.

 

Questions with Answers

Question 1. Given a package named IPL.cricket, what would be the import statement to include a class naming the Teams?
Answer:
import IPL.cricket.Teams;

 

Question 2. Mention one feature which is different in string objects and StringBuffer objects.
Answer:
String objects are immutable. The original (initial) string object remains unaltered.
StringBuffer objects are mutable. The object's initial value can be modified.

 

Question 3. What is a package? Give an example.
Answer:
A package is a collection of classes and interfaces. java.util package is an example.

 

Question 4. How are packages included in a program?
Answer:
By importing them using the keyword import.

 

Question 5. Name the following:
(a) A package that is invoked by default.
(b) A keyword to use the classes defined in a package.

Answer:
(a) java.lang
(b) import

 

Question 6. What is the use of exception handling in Java?
Answer:
Controlling errors during runtime of a program.

 

Question 7. Name the class that is used for different Mathematical function. Give an example of a Mathematical function.
Answer:
java.lang.Math
Example: Math.pow (a, b) represents \( a^b \).

 

Question 8. Give the output of the following expressions:
(a) If x = -9.99, calculate Math.abs (x);
(b) If x = 9.0, calculate Math.sqrt (x);

Answer:
(a) 9.99
(b) 3.0

 

Question 9. What is the use of the keyword import?
Answer:
To include a package in a program.

 

Question 10. What will the following functions return when executed?
(i) Math.max (-17, -19)
(ii) Math.ceil (7.8)

Answer:
(i) -17
(ii) 8.0

 

Question 11. What is an Exception? Name two exception handling blocks.
Answer:
Exception is an error or anomalous situation, which is come across during the runtime of a program.
try and catch are two exception handling blocks.

 

Question 12. State the purpose and return data type of the following string functions:
(i) indexOf ( ); (ii) compareTo ( )

Answer:
(i) Finds the index of the first occurrence of a character in a string. The return type is an integer (0, 1, 2 ... etc.).
(ii) Compares two strings lexicographically. Returns < 0, = 0 or > 0 according as the first string is dictionary positionwise less, equal or greater than the second string. The return type is an integer.

 

Question 13. How can you get the length of a string?
Answer:
By using the length ( ) method.
e.g. str.length ( );

 

Question 14. What is used to get the character at a particular index position in a string?
Answer:
charAt ( ) method

 

Question 15. Which method converts a given string into uppercase?
Answer:
toUpperCase ( )

 

Question 16. What will be the output of the following program segments?
(i)

double x = 29.31;
System.out.println (Math.ceil (x));
(ii)
double x = 34.98;
System.out.println (Math.floor (x));
(iii)
float x = 7.91f, y = 21.2f;
System.out.println (Math.rint (x));
System.out.println (Math.rint (y));

Answer:
(i) 30.0
(ii) 34.0
(iii) 8.0 and 21.0

 

Question 17. In the code fragment of,
char ch;
ch = "Jaio ho".charAt (5);
then what is ch?
Answer:
h

 

Question 18. Write a program to reverse the string "yrtnuoc ym si aidnI".
Answer:
class reverseString {
    public static void main (String args[ ]) {
        StringBuffer str = new StringBuffer ("yrtnuoc ym si aidnI");
        System.out.println ("given string is " + str);
        str.reverse ( );
        System.out.println ("string after reversing is " + str);
    }
}

Output: India is my country

 

Question 19. What will be the result of the following code?
String str1 = new String ("cat");
String str2 = new String ("cat");
(i) str1 == str2
(ii) str1.equals (str2);

Answer:
(i) false, as == operator compares the memory addresses of str1 and str2 which are different.
(ii) true, as the equals ( ) method compares the two actual strings.

 

Question 20. Illustrate by a program, the use of endsWith ( ) method.
Answer:
public class endsWithProgram {
    public static void main (String args[ ]) {
        String str = "Snows of Kilimanjaro";
        String endString = "jaro";
        boolean ends = str.endsWith (endString);
        // To show the results of the endsWith call.
        System.out.println (str + " ends with " + endString + "? " + ends);
    }
}

The outcome:
Snows of Kilimanjaro ends with jaro? true

 

Question 21. What will be the outcome of the following:
(i) "work is".concat (" worship");
(ii) boolean chr = Character.isWhitespace (' ');
(iii) boolean ch = Character.isLetter ('5');
(iv) boolean ch = Character.isDigit ('9');
(v) System.out.println ("Leaf".trim ( ) + "less".trim ( ));
(vi) char x = "Elizabeth".charAt (3);
(vii) String str = "conference".replace ('2', 'f');

Answer:
(i) work is worship
(ii) true
(iii) false
(iv) true
(v) Leafless
(vi) x will be 'z'
(vii) str becomes "conference" (there is no '2' in the string, so nothing is replaced).

 

Question 22. Write a program to calculate number of times the letter 'a' appears in a given string.
Answer:
class aCount {
    public void count (String str) {
        int l = str.length ( );   // Length of the string is ascertained
        int count = 0;
        for (int i = 0; i < l; i++)
        {
            char ch = str.charAt (i);
            if (ch == 'a')
                count++;
        }
        System.out.println ("The character a occurs " + count + " times");
    }
}

 

Question 23. Write a program to input any given string to calculate the total number of characters and vowels present in the string and also reverse the string.
Example:

INPUT
Enter string : SNOWY
OUTPUT
Total number of characters : 05
Number of vowels : 01
Reverse string : YWONS

Answer:
public class strHandling {
    public void calculate (String str) {
        int vowels = 0, l = str.length ( );
        char ch;
        String reverse = "";
        for (int i = 0; i < l; i++)
        {
            ch = str.charAt (i);
            reverse = ch + reverse;
            if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U'
                || ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
                vowels++;
        }
        System.out.println ("Total no. of characters = " + l);
        System.out.println ("No. of vowels = " + vowels);
        System.out.println ("Reverse string = " + reverse);
    }
}

 

Question 24. Define a class RecurringPatterns and define method in it which will print the following pattern for n = 4, after taking an integer argument n:
   x
  x x
 x x x
x x x x
 x x x
  x x
   x

Answer:
class RecurringPatterns {
    public void pattern (int n)
    {
        int i, j, k;
        for (i = 1; i <= n; i++)
        {
            for (k = 1; k <= n - i; k++)
                System.out.print (" ");
            for (j = 1; j <= i; j++)
                System.out.print ("x ");
            System.out.println ( );
        }
        for (i = n - 1; i >= 1; i--)
        {
            for (k = 1; k <= n - i; k++)
                System.out.print (" ");
            for (j = 1; j <= i; j++)
                System.out.print ("x ");
            System.out.println ( );
        }
    }
}

 

Question 25. Consider the following statement: "August 15 is celebrated as the Independence day of India". Write a program to change 15 to 26, August to January, Independence day to Republic and finally print "January 26 is celebrated as the Republic day of India".
Answer:
class makeChange {
    public static void main (String args[ ])
    {
        String str = "August 15 is celebrated as the Independence day of India";
        str = str + " ";
        String word;
        char ch;
        int n = 0, l = str.length ( );
        for (int i = 0; i < l; i++)
        {
            ch = str.charAt (i);
            if (ch == ' ')
            {
                word = str.substring (n, i);
                if (word.equals ("15"))
                    System.out.print ("26 ");
                else if (word.equals ("August"))
                    System.out.print ("January ");
                else if (word.equals ("Independence"))
                    System.out.print ("Republic ");
                else
                    System.out.print (word + " ");
                n = i + 1;
            }
        }
    }
}

Output: January 26 is celebrated as the Republic day of India

Chapter 07 Using Library Classes Concepts and Summary for Class 10 Computer Applications

Download Chapter Summary: Class 10 Computer Applications Chapter 07 Using Library Classes

Access structured revision notes for Chapter 07 Using Library Classes designed in alignment with the latest ICSE curriculum for Class 10 Computer Applications. These summaries help clarify core themes and support effective daily study.

Concept Clarification for Chapter 07 Using Library Classes

Built using the official NCERT book for Class 10 Computer Applications, these notes provide reliable academic guidance. Pair your summary review with our recommended NCERT solutions to master optimal problem-solving approaches.

Additional Study Resources for Class 10 Computer Applications

Wrap up your chapter revision by testing your knowledge against standard question formats. Everything on our platform is provided free of charge.

FAQs

Where can I download the latest PDF for ICSE Class 10 Computer Applications Chapter 07 Using Library Classes Notes and Important Questions with Answers?

You can download the teacher prepared revision notes for ICSE Class 10 Computer Applications Chapter 07 Using Library Classes Notes and Important Questions with Answers from StudiesToday.com. These notes are designed as per 2026-27 academic session to help Class 10 students get the best study material for Computer Applications.

Are these Computer Applications notes for Class 10 based on the 2027 board exam pattern?

Yes, our ICSE Class 10 Computer Applications Chapter 07 Using Library Classes Notes and Important Questions with Answers include 50% competency-based questions with focus on core logic, keyword definitions, and the practical application of Computer Applications principles which is important for getting more marks in 2027 ICSE exams.

Do these Class 10 notes cover all topic-wise concepts for Computer Applications?

Yes, our ICSE Class 10 Computer Applications Chapter 07 Using Library Classes Notes and Important Questions with Answers provide a detailed, topic wise breakdown of the chapter. Fundamental definitions, complex numerical formulas and all topics of ICSE syllabus in Class 10 is covered.

How can I use ICSE Class 10 Computer Applications Chapter 07 Using Library Classes Notes and Important Questions with Answers for quick last-minute revision?

These notes for Computer Applications are organized into bullet points and easy-to-read charts. By using ICSE Class 10 Computer Applications Chapter 07 Using Library Classes Notes and Important Questions with Answers, Class 10 students fast revise formulas, key definitions before the exams.

Is there any registration required to download Class 10 Computer Applications notes?

No, all study resources on StudiesToday, including ICSE Class 10 Computer Applications Chapter 07 Using Library Classes Notes and Important Questions with Answers, are available for immediate free download. Class 10 Computer Applications study material is available in PDF and can be downloaded on mobile.