CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickCards Java

Java: 36 revision cards

Every card below is written out in full underneath its picture, so you can read it, search it and copy from it. Free, no sign-up.

ICSE Java

ICSE Java

ICSE Class 9-10 · live online Java

Make BlueJ your strongest subject.

ICSE Computer Applications is a scoring paper, when your Java basics are solid.

From data types and operators to String methods, arrays, constructors and overloading, Kajal Ma'am teaches every concept with live coding, dry runs and board-style programs. Small batches or one-to-one, all online, all taught personally by her.

Study with KwickNotes, KwickSolution and KwickAssignment, and revise anytime with recorded classes.

ISC CS

ISC COMPUTER SCIENCE

Live online, with dry runs and practice

Recursion, OOP, Boolean algebra made clear

ISC Computer Science rewards students who understand, not those who memorise.

Recursion, inheritance, linked lists, stacks, queues and Boolean algebra can feel heavy. With 20+ years of teaching experience, Kajal Ma'am breaks each topic into small, traceable steps so you can write and explain programs with confidence.

Live online classes, small groups or one-to-one, with recorded versions for revision.

Java Output

ICSE JAVA

int / int drops the decimal part

In Java, 7/2 gives 3, not 3.5

One of the most common ICSE output questions.

With int a = 7 and int b = 2, a / b gives 3, not 3.5. When both operands are int, / gives an int result and drops the decimal part. a % b gives the remainder, 1. Cast one operand to double first, (double) a / b, and the division becomes real, giving 3.5.

Tip: always check the data types of both operands before you write the output.

Index the letters of BlueJ

ICSE CLASS 10 · STRING

Index the letters of BlueJ

  • B
  • l
  • u
  • e
  • J

charAt() starts at 0 · length() counts from 1

String methods appear in almost every ICSE Computer Applications paper.

Try these on String s = "BlueJ". s.length() counts characters: 5. s.charAt(2) uses zero-based indexing, so index 2 is 'u'. s.toUpperCase() returns a new string, BLUEJ. s.indexOf('J') returns the position of the first 'J', which is 4.

Remember: indexing starts at 0, but length() counts from 1.

Math methods: watch the return type

ICSE JAVA · MATH CLASS

Math methods: watch the return type

MethodReturns
round(double)long
round(float)int
ceil()double
floor()double
abs(int)int

ceil/floor give double: whole values print .0

Math.round(-2.5): is it -2 or -3? Many students get this wrong.

Math.round() adds 0.5 and takes the floor, so Math.round(-2.5) is -2. With a double argument it returns long, and with a float it returns int. Math.ceil(4.2) prints 5.0 and Math.floor(-4.5) prints -5.0, because both return double. Math.abs(-7) with an int argument returns the int 7.

In the exam, the return type decides whether you write the .0, and it is worth the mark.

Open this card

Trace a for loop that adds 3

Java Loops

Trace a for loop that adds 3

i += 3

  • i = 1
  • i <= 10 ?
  • print i
  • add 3

Dry-running a loop is a skill every ICSE student needs.

Take for(int i = 1; i <= 10; i += 3) System.out.print(i + " "); and follow the cycle. i starts at 1 and increases by 3 each time, so it prints 1 4 7 10. The next value, 13, fails the condition i <= 10, so the loop stops. It runs 4 times in total.

Make a small table with columns for i, the condition and the output, and you will never lose track of a loop again.

Java Operators

ICSE JAVA · OPERATORS

x++

  • Use the value
  • Then add 1

++x

  • Add 1 first
  • Then use it

x++ + ++x, a classic ICSE output question.

Take int x = 5; int y = x++ + ++x; and evaluate left to right. x++ uses the current value 5, then x becomes 6. ++x increases x to 7 first and then uses 7. So y = 5 + 7 = 12, and x ends at 7.

Rule to remember: postfix means use, then change. Prefix means change, then use.

Find the largest element

ICSE JAVA · ARRAYS

Find the largest element

  • 45
  • 78
  • 62
  • 91
  • 55

max = m[0], then replace with every bigger value

Finding the maximum in an array is a must-practise ICSE program.

Answer: Max = 91

We assume the first element is the largest, then compare every remaining element with max and replace it whenever we find a bigger value. Start the loop at index 1 because index 0 is already stored.

Try changing it to find the smallest element and its position, a common follow-up question.

Constructor

ICSE CLASS 10 · JAVA

Constructor
Same name as the class, no return type, and runs automatically when an object is created.

ExampleBox() vs Box(int l)

Constructors carry solid marks in ICSE Class 10 theory and programs.

A class can have more than one constructor. Box() is the default constructor and Box(int l) is a parameterised one. If Box() sets len to 1, then new Box() gives len 1 and new Box(5) gives len 5.

Key points: a constructor has the same name as the class, has no return type, and is called automatically when an object is created.

Which method runs each time?

ICSE JAVA · OVERLOADING

One name, three methods

Which method runs each time?

static int area(int s) {
    return s * s; }
static int area(int l, int b) {
    return l * b; }
static double area(double r) {
    return 3.14 * r * r; }
System.out.println(area(4));
System.out.println(area(4, 3));
System.out.println(area(2.0));

Function overloading: same method name, different parameter lists.

Output: 16, 12, 12.56

Java picks the method by matching the arguments. area(4) matches the single int version, area(4, 3) matches two ints, and area(2.0) matches the double version.

Note: a different return type alone is not enough to overload a method, the parameter list must differ in number, type or order of parameters. Overloading is a form of compile-time polymorphism.

Open this card

Java wrapper class methods

Java Wrappers

Java wrapper class methods

Wrapper classes

  • parseInt()
  • isDigit()
  • toUpperCase()
  • isLetter()
  • parseDouble()

Integer and Character methods are quick marks in ICSE, know them well.

Integer.parseInt("25") converts the string to the int 25, so adding 5 gives 30. Character.isDigit('7') returns true. Character.toUpperCase('k') returns 'K'. Character.isLetter() checks for a letter, and Double.parseDouble() converts a string to a double.

Also revise isLetterOrDigit(), isWhitespace() and isUpperCase(). Practise converting between String and numbers until it feels automatic.

Which constructor runs first?

ISC · INHERITANCE

Which constructor runs first?

  • new B()
  • Implicit super() call
  • Parent A() runs
  • Then B()'s body

In inheritance, the parent is always built before the child.

If class B extends A, and each constructor prints its own name, new B() prints A and then B. Java first calls the constructor of the superclass A (an implicit super() call), then runs the body of B's constructor.

In ISC, remember: if you write super(...) explicitly, it must be the first statement in the subclass constructor.

A stack using an array

ISC · DATA STRUCTURES

A stack using an array

  • 10
  • 20
  • 30

st[top--] reads the top, then moves down

Stack questions in ISC test whether you can track top correctly.

Three push operations store 10, 20 and 30, leaving top = 2. System.out.println(st[top--]) prints 30 and then moves top down to 1, so printing st[top] next gives 20.

Stack = LIFO: the last element pushed is the first one popped. Always check for overflow before push and underflow before pop.

Java data type sizes

ICSE JAVA · DATA TYPES

Java data type sizes

  • byte
  • short
  • char
  • int
  • long

Quick check: how many bits does a Java char use?

Answer: 16 bits, as the chart shows.

Java uses Unicode for characters, so a char takes 16 bits (2 bytes), unlike C where char is 1 byte. Its range is 0 to 65535.

Revise the full list: byte 8, short 16, int 32, long 64, float 32, double 64, char 16 bits, and boolean stores true or false (its size is not precisely defined in Java).

What does this statement print?

ICSE JAVA QUIZ

What does this statement print?

  1. 5532
  2. 3255
  3. 55
  4. 14
System.out.println(
  3 + 2 + "5" + 3 + 2);

Strings and numbers together, watch the order of evaluation.

Answer: A) 5532.

Java evaluates + from left to right. 3 + 2 is integer addition, giving 5. Then 5 + "5" becomes the string "55". After that, every + joins strings, so we get "553" and finally "5532".

Once a String enters the expression, the rest is concatenation. To add numbers after a string, put them in brackets: "5" + (3 + 2) gives "55".

primitive types in Java

ICSE JAVA

8 primitive types in Java

String is a class, not one of them

Primitive or not? String catches many students.

String is a class in the java.lang package, so it is a reference (non-primitive) type. Java has exactly eight primitive types: byte, short, int, long, float, double, char and boolean.

That is also why we compare strings with equals() and not ==. Primitive variables store values directly, while a String variable stores a reference to an object.

What does Math.sqrt(16) return?

ICSE JAVA QUIZ

What does Math.sqrt(16) return?

  1. 4
  2. 4.0
  3. 16.0
  4. Error

Return types matter in ICSE output questions.

Answer: B) 4.0.

Math.sqrt() always returns a double, even for perfect squares, so the output is 4.0. The same is true for Math.pow(), Math.cbrt(), Math.ceil() and Math.floor().

If you need an int, cast it: (int) Math.sqrt(16) gives 4. Knowing return types is the difference between full and partial marks in ICSE output questions.

Java Quiz

JAVA QUIZ

Think: Java never leaves garbage values

What fills new int[5] before you store?

What does Java put inside a new array before you store anything?

It is 0. When an array is created with new, Java fills it with default values: 0 for int, 0.0 for double, false for boolean, '\u0000' for char and null for objects such as String.

Unlike C, Java never leaves garbage values in array elements.

Simplify: A + A·B = ?

ISC BOOLEAN ALGEBRA

Simplify: A + A·B = ?

  1. A·B
  2. B
  3. A
  4. A + B

One line of Boolean algebra, can you simplify it in your head?

Answer: C) A.

This is the Absorption Law. A + A·B = A·(1 + B) = A·1 = A, because 1 + B is always 1.

The dual form is A·(A + B) = A. You can confirm both laws quickly with a two-variable truth table. In ISC, always name the law you use at each step, it earns method marks.

ISC Boolean

ISC · DE MORGAN'S LAW

(A + B)' = A'·B' and (A·B)' = A' + B'

Break the bar, change the sign

De Morgan's laws appear in almost every ISC Boolean algebra question.

The complement of a sum is the product of the complements: (A + B)' = A'·B'. Similarly, (A·B)' = A' + B'.

Easy way to remember: break the bar, change the sign. Verify it with a truth table once and you will never forget it. De Morgan's laws also extend to three or more variables.

Stack vs Queue in one table

ISC DATA STRUCTURES

Stack vs Queue in one table

StackQueue
RuleLIFOFIFO
Insert attoprear
Delete fromtopfront

Both can use arrays or linked lists

Stack or queue, do you know the rule each one follows?

A stack is LIFO, Last In, First Out: the element pushed last is popped first, like a pile of plates. A queue is FIFO, First In, First Out, like a line at a ticket counter.

In ISC, stacks use push and pop at one end (top), while queues insert at the rear and delete from the front. Both can be implemented with arrays or linked lists.

Which keyword calls the parent class constructor?

ISC JAVA QUIZ

Which keyword calls the parent class constructor?

  1. this
  2. super
  3. extends
  4. parent

Inheritance quick check for ISC students.

Answer: B) super.

super(...) calls the superclass constructor and must be the first statement inside the subclass constructor. super.methodName() calls an overridden method of the parent.

this refers to the current object, and extends is used to declare inheritance, as in class B extends A. Java supports single inheritance of classes, so a class can extend only one superclass.

Java primitives by size

ICSE · JAVA

Java primitives by size

  • byte
  • short
  • int
  • long
  • float
  • double

Save this for your ICSE Computer Applications revision.

Java has exactly eight primitive data types. Integers: byte, short, int and long. Real numbers: float and double. Characters: char, which uses 16-bit Unicode. Logical values: boolean.

Exam tip: a literal like 3.5 is double by default, so storing it in a float needs 3.5f. Similarly, long literals are written with L, like 900000000000L.

Not on the chart: char is 16 bits (Unicode) and boolean holds only true or false.

Java String methods to know

Java Revision

Java String methods to know

String methods

  • length()
  • charAt(i)
  • indexOf(ch)
  • substring(a,b)
  • toUpperCase()
  • equals()

String handling is one of the highest-weightage areas in ICSE Class 10 Java.

Practise each method with a small example and note its return type: length() and indexOf() return int, charAt() returns char, equals() returns boolean, and substring() returns a new String.

Remember: substring(a, b) includes index a but excludes index b.

Students who know these methods well finish string programs much faster in the exam.

Math methods: return types

ICSE · MATH CLASS

Math methods: return types

MethodReturns
sqrt() pow()double
ceil() floor()double
round(double)long
abs/max/minsame as arg
random()double

random() gives 0.0 to below 1.0

Most mistakes in Math output questions come from the return type.

If a method returns double, the output shows a decimal point, like 5.0. Math.round() on a double returns a long, so there is no decimal. Math.abs(), Math.max() and Math.min() return the same type as their arguments.

Write this list in your notebook and revise it the week before your board exam.

Which loop fits?

ICSE · LOOPS

Which loop fits?

  • Count known: for
  • Condition only: while
  • Run once first: do-while
  • Any loop: break exits

Choosing the right loop makes your programs cleaner and easier to explain.

for is entry-controlled and best for counting, like printing a series. while is also entry-controlled, and suits cases like extracting digits of a number until it becomes 0. do-while is exit-controlled, so its body runs at least once, useful for menu-driven programs.

ICSE questions often ask you to convert one loop into another. Practise it.

Java exam slips

Java Errors

Java exam slips

Do

  • == inside conditions
  • equals() for Strings
  • Close every brace
  • Index starts at 0

Don't

  • = inside an if
  • == to compare Strings
  • Missing semicolons
  • Loop one step off

Small slips cost big marks. Check your answers for these.

These are the mistakes that appear again and again in ICSE answer sheets. Most of them are not about understanding, they happen in a hurry.

Build a habit: after writing each program, spend 30 seconds checking conditions, string comparisons, braces and loop limits.

Error-spotting questions in the paper test exactly these points.

The four pillars of OOP

ISC · OOP

The four pillars of OOP

  • Encapsulation
  • Abstraction
  • Inheritance
  • Polymorphism

Every ISC Computer Science student should be able to explain these four in their own words.

Encapsulation wraps data members and methods inside a class, often with private data and public methods. Abstraction hides implementation details. Inheritance lets a subclass reuse and extend a superclass using extends. Polymorphism is seen in method overloading and overriding.

In theory answers, always support each definition with a short Java example.

Queue: first in, first out

ISC · DATA STRUCTURES

Queue: first in, first out

  • A
  • B
  • C
  • D

Enqueue at rear, dequeue at front

Stacks and queues look similar but behave very differently.

In a stack, the most recently added item leaves first, think of a pile of books. In a queue, the earliest item leaves first, think of students lining up.

ISC questions ask you to implement both using arrays, handle overflow and underflow, and sometimes compare them with linked-list versions.

Practise tracing push, pop, insert and delete step by step.

How many times does each loop print?

ICSE · LOOPS

while vs do-while

How many times does each loop print?

int i = 10;
while (i < 5) {
  System.out.print(i);
}
do {
  System.out.print(i);
} while (i < 5);

The difference between while and do-while is a classic ICSE question.

If int i = 10 and the condition is i < 5, a while loop will not run at all, but a do-while loop will run its body once before checking the condition.

Use do-while when the body must execute at least once, such as showing a menu before asking for the choice.

Do not forget the semicolon at the end of a do-while, it is a common error.

Answer: the while loop prints nothing, and the do-while prints 10 once.

Open this card

What does this code print?

ICSE · STRING

What does this code print?

  1. true
  2. false
  3. Java
  4. Compile error
String a = new String("Java");
String b = new String("Java");
System.out.println(a == b);

Why does == sometimes say two identical strings are different?

Strings are objects in Java. The == operator checks whether two variables refer to the same object, not whether they contain the same text. Strings created with new String("Java") are separate objects, so == returns false even though the text matches.

equals() compares the characters one by one, which is what you almost always want.

In ICSE programs, always use equals() for strings.

Answer: B) false.

A linked list grows by links

ISC · LINKED LISTS

A linked list grows by links

  • 12
  • 25
  • 37
  • 49

Insert by changing links, no shifting

Arrays and linked lists both store sequences, the trade-offs matter.

Arrays give fast access to any element through its index, but their size is fixed. A linked list is made of nodes, each holding data and a link to the next node, so it can grow easily, but you must traverse it to reach an element.

ISC asks you to write algorithms or methods to insert, delete and traverse nodes in a linked list. Practise drawing the links before writing code.

Is recursion always better?

ISC Myth

Is recursion always better?

  • Every call uses stack memory
  • Too deep: StackOverflowError

Myth: A recursive solution always beats a loop.

Recursion is elegant, but it is not magic.

For problems like tree traversal or the Tower of Hanoi, recursion makes the logic natural. For simple tasks such as summing 1 to n, an iterative loop uses less memory.

In ISC, you are often asked to write the same logic both ways, so understand the trade-off rather than choosing one blindly.

Always make sure your base case is reachable.

Java Myth

ICSE JAVA

Memorised programs break when inputs change.

Understand first. Then practise.

Memorised programs break the moment the question changes slightly.

ICSE Computer Applications papers often twist a familiar program, a different series, a new condition, or an extra output requirement. Students who understand each step can adapt quickly.

Build logic by dry-running programs, writing variations yourself, and explaining your code aloud.

That is how Kajal Ma'am teaches: understand first, then practise until it is natural.

Dry run with a trace table

ICSE · DRY RUN

Dry run with a trace table

Stepisum
start10
pass 121
pass 233
pass 346

One column per variable, one row per step

Output questions become easy once you dry run them the right way.

Guessing the output from memory leads to mistakes. A dry-run table keeps every change visible, especially for loops, increments and nested conditions.

Notice whether the code uses print() or println(), because that decides whether output appears on the same line.

Practise this method on every output question for two weeks and you will see the difference.

The table traces: int sum = 0; for (int i = 1; i <= 3; i++) sum += i; The loop stops when i becomes 4, so sum is 6.

Open this card

Write a recursive method

ISC Method

Write a recursive method

fact(n)

  • Smaller version
  • Base case
  • Recursive call
  • Combine result
  • Trace to verify

Recursion becomes a process, not a puzzle.

Take factorial as an example. The smaller version: n! = n × (n - 1)!. The base case: if n is 0, return 1. The recursive call: fact(n - 1). Combine: return n * fact(n - 1). Then trace fact(3) = 3 × 2 × 1 × 1 = 6.

Follow these five steps for every ISC recursion question, from digit sums to binary conversion.

Want this taught, not just read? Kajal Ma'am teaches these live, in small batches.
Book a free demo class

Written by Kajal Mehta (Kajal Ma'am), MCA, teaching computer subjects since 2004. All KwickCards

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →