ICSE Class 10 · Computer Applications (Java) · Library classes 2027

Wrapper classes for ICSE Class 10, with every method run in Java.

Wrapper classes in ICSE Class 10 are a short chapter with a long reach: the same twelve methods turn up in one-mark MCQs, in output questions and inside almost every string program in Section B. This page lists all twelve as the 2027 syllabus names them, shows the exact value each returns (every one was run in Java 21, including the inputs that crash), explains autoboxing and unboxing with code, and works two class-design programs that depend on them. In our live mini batch these outputs are traced first and then checked in BlueJ.

Live online · all twelve listed methods · outputs from real Java · autoboxing in code · two Section B programs · first class free

Start here

Courses where wrapper classes are used every week

Our BlueJ course for Classes 9 and 10 is where the twelve methods get used week after week. ISC Computer Science leans on Character and parse methods for its string and number questions, and Java for Teens suits a student who wants Java practice outside the board pattern.

Ans. The short version

Wrapper classes in ICSE Class 10 are the library classes that wrap each primitive type in an object: Byte, Short, Integer, Long, Float, Double, Character and Boolean, all in java.lang. The 2027 syllabus lists twelve methods: parseInt, parseLong, parseFloat and parseDouble, which turn a String into a number, and the Character methods isDigit, isLetter, isLetterOrDigit, isLowerCase, isUpperCase, isWhitespace, toLowerCase and toUpperCase. Autoboxing converts a primitive to its wrapper automatically; unboxing does the reverse. Our live classes drill all of it in a small Tuesday and Wednesday evening group in India, with personalised one to one lessons for any family that needs another hour.

Q1. What are wrapper classes and library classes?

What are wrapper classes in Java? Library classes ICSE definitions

A wrapper class is a library class that stores one value of a primitive type inside an object and gives methods to work with it. A library class is a ready-made class that comes with Java, so a program can use it without writing it.

Primitive typeWrapper classSpelling trap
byteByteCapital B
shortShortCapital S
intIntegerNot "Int": the full word
longLongCapital L
floatFloatCapital F
doubleDoubleCapital D
charCharacterNot "Char": the full word
booleanBooleanCapital B

Four facts that answer most one-mark questions

  1. All eight wrapper classes are in the package java.lang, which every program imports automatically, so no import line is needed.
  2. Two names differ from their primitive: int becomes Integer and char becomes Character. The other six only gain a capital letter.
  3. Wrapper classes are needed because some parts of Java work only with objects, and because the conversion and testing methods live in these classes.
  4. String is a library class too, but it is not a wrapper class: there is no primitive type called string.

Primitive and composite types, which this chapter leans on, are defined on class as the basis of all computation, and the other big library class in the syllabus, Math, has its own page: Math library methods for ICSE Class 10.

Q2. What is autoboxing and unboxing?

Autoboxing and unboxing in Java, with output

Autoboxing is the automatic conversion of a primitive value into an object of its wrapper class; unboxing is the automatic conversion of a wrapper object back into its primitive value. Java does both by itself whenever one type is used where the other is expected.

Boxing and unboxingrun in Java 21
Integer a = 25;          // autoboxing: int 25 into an Integer
int b = a + 5;           // unboxing: a gives back 25
System.out.println(b);

Double d = 4.5;          // autoboxing
double e = d * 2;        // unboxing, then multiply
System.out.println(e);

Character c = 'k';       // autoboxing a char
char ch = c;             // unboxing
System.out.println(Character.toUpperCase(ch));

Boolean flag = true;
System.out.println(!flag);

// Output
30
9.0
K
false

No method is called for the conversion; the assignment alone does it. That is what "auto" means in an answer.

PointAutoboxingUnboxing
DirectionPrimitive to wrapper objectWrapper object to primitive
ExampleInteger a = 25;int b = a;
Happens whenA primitive is stored where an object is expectedAn object is used in arithmetic or stored in a primitive
Who does itThe Java compiler, automaticallyThe Java compiler, automatically

Two methods outside the twelve on the syllabus list appear in some textbooks: Integer.valueOf("40") returns an Integer object (so Integer.valueOf("40") / 3 prints 13 after unboxing), and Integer.toString(70) returns the String "70". They are useful to recognise, but parseInt is the one to learn for the paper.

Q3. What does Integer.parseInt do, and what are the other parse methods?

Integer.parseInt ICSE: the four parse methods with exact outputs

Integer.parseInt(s) converts a String of digits into an int, so the value can be used in arithmetic. parseLong, parseFloat and parseDouble do the same for long, float and double. Every result below was printed by Java 21.

Syllabus methodCodeOutputNote
int parseInt(String s)Integer.parseInt("472") + 8480Converted, then added. Compare "472" + 8, which joins to 4728
Integer.parseInt("-35") * 2-70A leading minus sign is allowed
Integer.parseInt("007")7Leading zeros are dropped; the result is a number, not text
Integer.parseInt("12.5")NumberFormatExceptionA decimal point is not allowed in an int
Integer.parseInt(" 42")NumberFormatExceptionA space is not a digit: trim() first
long parseLong(String s)Long.parseLong("9876543210") + 19876543211Too big for int, fine for long
float parseFloat(String s)Float.parseFloat("2.5") * 25.0A float result prints with a decimal point
double parseDouble(String s)Double.parseDouble("3") / 21.5"3" becomes 3.0, so the division is real
Double.parseDouble("-7.25")-7.25Sign and decimal point both accepted

The exact message Java 21 printed for the bad input was java.lang.NumberFormatException: For input string: "12.5". An exam answer only needs the name: the program stops with a NumberFormatException because the String is not a valid int.

A digit character to its valuetwo ways
char dg = '8';
System.out.println(dg - '0' + 1);
System.out.println(Integer.parseInt("" + dg) + 1);

// Output
9
9

parseInt needs a String, so "" + dg turns the char into one first. Subtracting '0' gives the same value with char arithmetic.

When a program needs parseInt

  1. A number arrives inside a String, for example a record such as Riya,78,91 read with nextLine().
  2. Digits are pulled out of a longer String with substring and must then be added or compared.
  3. A digit character has been collected into a String and needs its numeric value.

Q4. Which Character class methods are in the ICSE syllabus?

Character class methods in Java for ICSE, each with its output

Eight Character methods are listed: six tests that return boolean and two converters that return char. All are called on the class, as Character.isDigit(ch), never on a variable.

Syllabus methodCodeOutputNote
boolean isDigit(char ch)Character.isDigit('7') + " " + Character.isDigit('x')true falseOnly 0 to 9 count
boolean isLetter(char ch)Character.isLetter('g') + " " + Character.isLetter('9')true falseEither case counts as a letter
boolean isLetterOrDigit(char ch)Character.isLetterOrDigit('@') + " " + Character.isLetterOrDigit('Q')false trueSymbols and spaces give false
boolean isLowerCase(char ch)Character.isLowerCase('b') + " " + Character.isLowerCase('B') + " " + Character.isLowerCase('5')true false falseA digit is neither lower nor upper case
boolean isUpperCase(char ch)Character.isUpperCase('Z') + " " + Character.isUpperCase('#')true falseSymbols are not upper case
boolean isWhitespace(char ch)Character.isWhitespace(' ') + " " + Character.isWhitespace('\n') + " " + Character.isWhitespace('_')true true falseSpace, tab and new line count; underscore does not
char toLowerCase(char ch)Character.toLowerCase('M') + " " + Character.toLowerCase('m')m mA lowercase letter comes back unchanged
char toUpperCase(char ch)Character.toUpperCase('#')#Anything that is not a letter comes back unchanged

The return-type trap: char plus int

CodeOutputWhy
System.out.println(Character.toUpperCase('a') + 1);66'A' is code 65; a char plus an int is an int
System.out.println((char) (Character.toUpperCase('a') + 1));BThe cast turns 66 back into a character
System.out.println("" + Character.toUpperCase('a') + 1);A1The empty String arrives first, so both values are joined
Toggle the case of a sentencerun in Java 21
String s = "Board 2027 Prep";
String t = "";
for (int i = 0; i < s.length(); i++) {
    char x = s.charAt(i);
    if (Character.isUpperCase(x))
        t = t + Character.toLowerCase(x);
    else if (Character.isLowerCase(x))
        t = t + Character.toUpperCase(x);
    else
        t = t + x;            // digits and spaces kept
}
System.out.println(t);

// Output: bOARD 2027 pREP

The final else matters: without it, the digits and spaces would be lost from the result.

How to remember the eight

  1. Six start with is and answer a yes or no question, so they return boolean.
  2. Two start with to and hand back a changed character, so they return char.
  3. isWhitespace has a lower-case s in "space"; isLetterOrDigit has capital O and D.
  4. None of them changes the variable passed in; store the result if you need it.

These eight methods do most of the work in sentence programs, which are collected on ICSE Class 10 string programs, and longer fragments to trace, sorted by trap, sit on the output questions page.

Q5. How do wrapper methods appear in Section B?

Library classes ICSE programs: two Section B questions, solved and run

Section B rarely says "use wrapper classes". It asks you to classify characters or to pull numbers out of text, and the Character tests and parseInt are the tools that make the answer short. Both questions below are original and set in the class-design format.

Question 1. Define a class CharCensus with data members text (String) and upper, lower, digits, spaces, others (int). Write a default constructor to initialise them, void accept() to read a sentence, void count() to count the uppercase letters, lowercase letters, digits, whitespace characters and other characters using Character class methods, and void display(). In main, make one object and invoke the three methods in order.

CharCensus.javaCharacter methods
import java.util.Scanner;
class CharCensus {
    String text;   // the sentence entered
    int upper;     // uppercase letters
    int lower;     // lowercase letters
    int digits;    // digit characters
    int spaces;    // whitespace characters
    int others;    // everything else

    CharCensus() {                 // default constructor
        text = "";
        upper = 0;
        lower = 0;
        digits = 0;
        spaces = 0;
        others = 0;
    }

    void accept() {
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter a sentence:");
        text = sc.nextLine();
    }

    void count() {
        for (int i = 0; i < text.length(); i++) {
            char ch = text.charAt(i);
            if (Character.isUpperCase(ch))
                upper++;
            else if (Character.isLowerCase(ch))
                lower++;
            else if (Character.isDigit(ch))
                digits++;
            else if (Character.isWhitespace(ch))
                spaces++;
            else
                others++;
        }
    }

    void display() {
        System.out.println("Uppercase letters : " + upper);
        System.out.println("Lowercase letters : " + lower);
        System.out.println("Digits            : " + digits);
        System.out.println("Spaces            : " + spaces);
        System.out.println("Other characters  : " + others);
    }

    public static void main(String args[]) {
        CharCensus ob = new CharCensus();
        ob.accept();
        ob.count();
        ob.display();
    }
}

One if-else-if chain means each character is counted exactly once. The final else catches commas, colons and every other symbol.

VariableTypePurpose
textStringthe sentence entered
upper, lowerintcounts of uppercase and lowercase letters
digitsintcount of digit characters
spacesintcount of whitespace characters
othersintcount of all remaining characters
chcharthe character being tested
iintloop counter over the sentence
obCharCensusthe object created in main
Sample runJava 21
Enter a sentence:
ICSE Exam on 17 March, 2027: Room B-12!
Uppercase letters : 8
Lowercase letters : 12
Digits            : 8
Spaces            : 7
Other characters  : 4

The four others are the comma, the colon, the hyphen and the exclamation mark. 8 + 12 + 8 + 7 + 4 is 39, the length of the sentence.

Question 2. A record is typed as a name followed by marks, separated by commas, for example Riya,78,91,66,84. Define a class MarksLine with data members line, name (String) and total, count, high (int). Write a parameterized constructor MarksLine(String l) to store the record and initialise the other members, void extract() to separate the name and convert each mark with Integer.parseInt(), and void display() to print the name, the number of marks, the total, the highest mark and the average to one decimal place.

MarksLine.javaparseInt in a program
import java.util.Scanner;
class MarksLine {
    String line;    // the record, for example Riya,78,91,66
    String name;    // the part before the first comma
    int total;      // sum of the marks
    int count;      // number of marks found
    int high;       // highest mark

    MarksLine(String l) {          // parameterized constructor
        line = l.trim() + ",";      // a comma at the end closes the last part
        name = "";
        total = 0;
        count = 0;
        high = 0;
    }

    void extract() {
        String part = "";
        for (int i = 0; i < line.length(); i++) {
            char ch = line.charAt(i);
            if (ch != ',') {
                part = part + ch;
            } else {
                if (name.equals(""))
                    name = part;                       // first part is the name
                else {
                    int m = Integer.parseInt(part.trim()); // text to int
                    total = total + m;
                    count++;
                    if (m > high)
                        high = m;
                }
                part = "";
            }
        }
    }

    void display() {
        double avg = (double) total / count;
        System.out.println("Name    : " + name);
        System.out.println("Marks   : " + count);
        System.out.println("Total   : " + total);
        System.out.println("Highest : " + high);
        System.out.println("Average : " + Math.round(avg * 10) / 10.0);
    }

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter name and marks separated by commas:");
        String s = sc.nextLine();
        MarksLine ob = new MarksLine(s);
        ob.extract();
        ob.display();
    }
}

part.trim() before parseInt is what lets the record contain a space after a comma; without it the program stops with a NumberFormatException.

VariableTypePurpose
lineStringthe record with a closing comma added
nameStringthe student's name
total, count, highintsum, number and highest of the marks
lStringconstructor parameter: the record
partStringthe piece being built between commas
mintone mark, converted by parseInt
avgdoubleaverage of the marks
s, sc, obString, Scanner, MarksLineinput line, keyboard reader, the object
Sample runsJava 21
Enter name and marks separated by commas:
Riya,78, 91,66,84
Name    : Riya
Marks   : 4
Total   : 319
Highest : 91
Average : 79.8

Enter name and marks separated by commas:
Kabir,55,60
Name    : Kabir
Marks   : 2
Total   : 115
Highest : 60
Average : 57.5

319 / 4 is 79.75; Math.round(797.5) is 798, so one decimal place gives 79.8. The space before 91 in the first run is handled by trim.

The constructor rules both programs rely on are on constructors ICSE Class 10 questions, and every other kind of Section B program is gathered in the Java programs practice hub.

Q6. What do Section A wrapper class questions look like, and how are they taught?

Wrapper class questions with answers, and how the batch drills them

Original questions in the shapes of Question 1 and Question 2. Answer each on paper, then open it.

  1. Name the wrapper class of char.
    Answer Character.
  2. Which package contains the wrapper classes?
    Answer java.lang, imported automatically.
  3. Give the output: Character.isLetterOrDigit('$')
    Answer false. The symbol is neither a letter nor a digit.
  4. What is the return type of Character.toUpperCase(ch)?
    Answer char.
  5. Define autoboxing with one example.
    Answer The automatic conversion of a primitive value into an object of its wrapper class, as in Integer n = 45;.
  6. Give the output: System.out.println(Integer.parseInt("15") + Integer.parseInt("5") + "0");
    Answer 200. The two ints add to 20 first, then "0" is joined on.
  7. Write a statement to convert the String s = "62.5" into a double.
    Answer double d = Double.parseDouble(s);
  8. State one situation in which Integer.parseInt throws an exception.
    Answer When the String is not a valid whole number, for example "12.5", "4a" or a String with a space in it.
  1. Twelve methods recalled on Tuesday

    Tuesday evening (5:30 PM IST) opens with every student writing all twelve signatures from memory, return type first, and the group checks spelling and case together.

  2. Outputs traced, then run

    Fragments like the tables above get a written answer first; then the mentor types each into BlueJ, and 66 against B settles itself in front of everyone.

  3. A Character program on Wednesday

    Wednesday evening (8:00 PM IST) is for one sentence or record program, written by hand with its variable description table, marked against the scheme on screen, then typed and tested with awkward input.

  4. Mock papers from December

    Wrapper questions return inside full two-hour papers, marked like the board, with every lost mark discussed in doubt time.

More one-mark questions across every chapter are on ICSE Computer Applications MCQ questions.

Batch or personalised: you choose

Practise wrapper classes in the mini batch, or one to one

The method tables, the traced outputs and the two programs are taught the same way in both formats. Families in India choose between the small evening group and private lessons; for ICSE students living abroad the classes are always private. Billing is monthly, with no admission fee.

Option 1 · Fixed batch timings

Mini batch, Tuesday 5:30 PM and Wednesday 8 PM

₹2,999

per month, two live classes a week

  • Tuesday 5:30 PM and Wednesday 8:00 PM IST, live
  • No more than six ICSE Class 10 students
  • All twelve methods recalled and spelt correctly
  • Outputs traced, then run in BlueJ
  • A character or parse program written each fortnight
Book a free demo in this batch

Option 2 · Choose your own timing

Personalised one to one

₹4,999

per month, one private class a week, at a time set with you

  • A slot the family chooses, in India or abroad
  • Time spent on the methods your child mixes up
  • Sentence programs built together, then solo
  • Tougher record and text programs as confidence grows
  • Same mentors, same 2027 syllabus, same BlueJ checks
Ask for a personalised plan

A student who mostly confuses return types, or writes Int and Char for the class names, often needs only a few one to one sessions. A student who also needs steady practice on whole Section B programs gets more from the two batch evenings each week. Fees appear in your own currency.

Studying outside India?

Wrapper class practice for ICSE students abroad

An ICSE school in the Gulf or South East Asia sits the very paper a school in Kolkata sits, twelve methods included. Abroad, every lesson is private and lands at an early evening hour by the local clock.

Where you liveTime differenceUsual class window, local timeFormat
India (IST)
every Indian city
ISTTue 5:30 PM, Wed 8:00 PMMini batch or 1-on-1
United Arab Emirates
Dubai, Sharjah
1 h 30 min behind India3:00 PM to 9:00 PMPersonalised 1-on-1
Indonesia and Thailand
West Java, Bangkok area
1 h 30 min ahead of India3:30 PM to 9:00 PMPersonalised 1-on-1
Singapore
Singapore
2 h 30 min ahead of India3:30 PM to 9:00 PMPersonalised 1-on-1

The time is agreed after the free demo and can shift around school tests. For how the classes run for families abroad, see ICSE Computer Applications classes in the Gulf and abroad.

What families say

Rated 4.9 across 547 Google reviews

Real reviews from real families. We neither write nor commission them.

★★★★★

"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."

Ria Mukherjee

Parent

★★★★★

"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."

Samriddha Mondal

Student

★★★★★

"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."

Vansh Agarwal

Student

★★★★★

"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."

Sonam Oswal

Parent of Dhairya

★★★★★

"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."

Sonu Goyal

Parent

★★★★★

"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."

Ritu Kedia

Parent

The rest of the Class 10 series

More pages for Class 10 board students

Every page in the ICSE Class 10 Computer Applications series, grouped by what you need: classes, each chapter, Section B programs, question practice, notes and revision, and the exam itself.

CBSE Class 10 AI (417): The Mon and Wed 9 PM AI batch CBSE AI 417 syllabus explained CBSE AI important questions Sample paper and mock tests

Questions about wrapper classes

What students ask about wrapper classes in ICSE Class 10

What are wrapper classes in Java ICSE Class 10?

Wrapper classes are library classes that hold a primitive value inside an object and provide methods for it. There is one for each primitive type: Byte, Short, Integer, Long, Float, Double, Character and Boolean. They are in java.lang, so no import is needed.

What are library classes in ICSE?

Library classes are ready-made classes supplied with Java, grouped into packages, which a program can use without writing them. For ICSE Class 10 the ones that matter are the wrapper classes, Math, String and Scanner. The Library classes chapter itself covers the wrapper classes and autoboxing.

What is autoboxing and unboxing in Java?

Autoboxing is Java automatically converting a primitive value into an object of its wrapper class, as in Integer n = 45. Unboxing is the reverse, an Integer object automatically giving back its int, as in int k = n + 1. No method call is written for either.

What does Integer.parseInt do in ICSE?

Integer.parseInt(String s) converts a String containing a whole number into an int, so it can be used in arithmetic. Integer.parseInt("472") + 8 gives 480, while "472" + 8 gives 4728. If the String is not a valid whole number, such as "12.5", the program stops with a NumberFormatException.

Which Character class methods are in the ICSE syllabus?

Eight: isDigit, isLetter, isLetterOrDigit, isLowerCase, isUpperCase and isWhitespace, which return boolean, and toLowerCase and toUpperCase, which return char. Each takes one char and is called on the class, as in Character.isDigit(ch).

Which wrapper class methods must I learn for ICSE 2027?

The syllabus lists twelve: parseInt, parseLong, parseFloat and parseDouble, and the eight Character methods isDigit, isLetter, isLetterOrDigit, isLowerCase, isUpperCase, isWhitespace, toLowerCase and toUpperCase. Learn each one's return type as well as what it does.

Why does Character.toUpperCase('a') + 1 print 66?

toUpperCase returns the char A, whose code is 65. Adding the int 1 to a char gives an int, so 66 is printed. To print the letter B, cast the result back: (char) (Character.toUpperCase('a') + 1).

Is String a wrapper class?

No. String is a library class in java.lang, but it is not a wrapper class, because there is no primitive type called string for it to wrap. The eight wrapper classes match the eight primitive types exactly.

What is the difference between Integer and int?

int is a primitive type that stores a whole number directly. Integer is a wrapper class whose object holds an int and offers methods such as parseInt. Java converts between them automatically through autoboxing and unboxing.

Do you teach wrapper classes in live classes?

Yes. The small group meets twice a week, 5:30 PM IST on Tuesday and 8:00 PM IST on Wednesday; the twelve methods are recalled, their outputs predicted, and Character and parseInt programs written and checked in BlueJ. If those evenings clash with school, personalised one to one lessons go at a time you pick.

Start

Book a free wrapper classes demo

In the free demo your child predicts the output of a handful of parse and Character method calls, sees each run in BlueJ, then starts a short sentence program with the mentor. Afterwards the mentor tells you plainly which methods your child already owns, which need work, and which format fits.

Want the wider view first? See ICSE Computer Applications important questions or the ICSE Class 10 Java classes.

WhatsApp us · +91 91233 66161 · connect@modernagecoders.com

Every class is live video. The form requests a callback and reserves nothing.

We call within a few hours. No card, no enrolment fee.

Want it sooner? Book a priority demo

A full live class of about 45 to 60 minutes at a slot you pick, with a written skill report and learning roadmap on WhatsApp afterwards. The fee is adjusted against your first month if you enrol.

Book a priority demo

Keep exploring Modern Age Coders

By class and age

Learn more

Free resources

From the blog

Start here