Skip to content
Computer ApplicationsICSE Class 9 · Chapter 4

Operators in Java ICSE Class 9: Types, Precedence, Increment and Decrement

Updated 15 October 2026 · Fact-checked

An operator is a symbol that performs an operation on one or more operands. ICSE Class 9 tests the forms of operators (unary, binary, ternary), the types (arithmetic, relational, logical, assignment, increment, decrement, shorthand), prefix and postfix, precedence and associativity, counters and accumulators, the new and dot operators, and print() and println().

What Operators in Java is about

Operators turn data into results: adding marks, comparing ages, checking two conditions together, counting entries. Most errors in output questions come from three things: integer division, the difference between prefix and postfix increment, and the order in which operators are applied.

The CISCE syllabus asks for: forms of operators (unary, binary, ternary); types of operators (arithmetic, relational, logical, assignment, increment, decrement, shorthand); counters and accumulators; the hierarchy (precedence) and associativity of operators; prefix and postfix; dynamic memory creation with the new operator; invoking members with the dot operator; and System.out.print() and System.out.println() for simple output. Bitwise and shift operators are exempted.

In output questions, write the value of every variable after each step (our advice): a written trace lets you, and your teacher, find exactly where a slip happened.

Weightage: CISCE publishes no chapter weightage and no question-paper layout for ICSE Class 9 Computer Applications. Class IX is examined by your school: one 100-mark theory paper of 2 hours, plus 100 marks of internal assessment (at least 15 programming assignments and a written project on ethical computing). This is topic 4 of the 2028 syllabus.Source: CISCE ICSE 2028 Computer Applications syllabus, Class IX

Key concepts

Forms of operators: unary, binary, ternary

An operand is a value or variable on which an operator acts. Operators are classified by the number of operands:

  • Unary operators act on one operand: unary minus (−a), unary plus (+a), increment (++), decrement (--), logical NOT (!).
  • Binary operators act on two operands: + − * / % (arithmetic), < > <= >= == != (relational), && || (logical), = and += etc. (assignment).
  • Ternary operator acts on three operands: the conditional operator ?:

The conditional (ternary) operator:
condition ? value-if-true : value-if-false
int big = (m > n) ? m : n; // with m = 8, n = 12, big = 12
String res = marks >= 40 ? "Pass" : "Fail"; // with marks = 72: Pass
It is a compact replacement for a simple if-else that chooses a value.

Worked example

(2 marks) Rewrite using the ternary operator: if (a > b) max = a; else max = b;

Try it first, then show the solutionSolution
  1. Condition a > b; true value a; false value b - 1 mark.
  2. max = (a > b) ? a : b; - 1 mark.

Answer: max = (a > b) ? a : b;

Arithmetic, relational and logical operators

Arithmetic: + (add), − (subtract), * (multiply), / (divide), % (modulus: remainder).

  • Integer division drops the fraction: 7 / 2 = 3; −7 / 2 = −3.
  • % gives the remainder and takes the sign of the left operand: 17 % 5 = 2; −17 % 5 = −2; 17 % −5 = 2. It also works on decimals: 5.5 % 2 = 1.5.
  • Uses of %: test even/odd (n % 2 == 0), extract the last digit (n % 10), test divisibility.

Relational (comparison): < > <= >= == != . They compare two values and give a boolean (true or false): 5 > 3 is true. Note == compares; = assigns.

Logical: combine or reverse boolean conditions.

  • && (AND): true only if both are true.
  • || (OR): true if at least one is true.
  • ! (NOT): reverses the value.

Short-circuit evaluation: in A && B, if A is false, B is not evaluated; in A || B, if A is true, B is not evaluated. As run in this study guide:
int p = 5; boolean r = (p > 10) && (++p > 5); gives r = false, p = 5 (++p never ran).
int q = 5; boolean s = (q > 1) || (++q > 5); gives s = true, q = 5.

Worked example

(2 marks) Give the output: System.out.println(17 % 5 + " " + (-17 % 5) + " " + (17 % -5) + " " + 5.5 % 2);

Try it first, then show the solutionSolution
  1. 17 % 5 = 2; −17 % 5 = −2 (sign of the left operand) - 1 mark.
  2. 17 % −5 = 2; 5.5 % 2 = 1.5 - 1 mark.

Answer: 2 -2 2 1.5

Assignment and shorthand operators; counters and accumulators

Assignment operator =: stores the value on the right in the variable on the left: x = 5;

Shorthand (compound assignment) operators combine an arithmetic operation with assignment: += −= *= /= %=
a += 3 means a = a + 3; i *= 2 + 3 means i = i * (2 + 3): the whole right side is worked out first. With i = 7, i *= 2 + 3 gives 35.
Shorthand operators include an automatic cast: char ch = 'a'; ch += 2; gives 'c' (whereas ch = ch + 2; does not compile).

Counter: a variable that counts how many times something happens; it starts at 0 and increases by 1 each time: count = count + 1; or count++;
Accumulator: a variable that collects a running total; it starts at 0 (or 1 for a product) and adds each new value: sum = sum + x; or sum += x;
As run in this study guide (three values 15, 25, 35):
count = count + 1; sum = sum + 15;
count++; sum += 25;
count++; sum += 35;
count = 3, sum = 75, average = (double) sum / count = 25.0
In later chapters counters and accumulators are used inside loops.

Worked example

(2 marks) Distinguish between a counter and an accumulator with an example of each.

Try it first, then show the solutionSolution
  1. Counter: counts occurrences, increased by 1, e.g. count++ - 1 mark.
  2. Accumulator: builds a running total, increased by a value, e.g. sum += marks - 1 mark.

Answer: A counter records how many times an event occurs and is increased by 1 each time (count++). An accumulator stores a running total and is increased by each new value (sum = sum + marks).

Increment and decrement: prefix and postfix

++ adds 1 and -- subtracts 1 from a variable. Each has two forms:

  • Prefix (++a, --a): change first, then use. The new value is used in the expression.
  • Postfix (a++, a--): use first, then change. The old value is used in the expression, and the variable is changed afterwards.

On its own as a statement (a++; or ++a;) both simply add 1.

Traces (as run in this study guide):
1. int a = 5; int b = a++ + ++a;
a++ gives 5 (a becomes 6); ++a makes a 7 and gives 7; b = 5 + 7 = 12; a = 7.
2. int k = 4; int y = k-- * 2 + --k;
k-- gives 4 (k becomes 3); 4 * 2 = 8; --k makes k 2 and gives 2; y = 10; k = 2.
3. int x = 10; x += x++ + --x;
The old x (10) is saved for the +=; x++ gives 10 (x becomes 11); --x gives 10; right side = 20; x = 10 + 20 = 30.
4. int z = 3; z = z++ + z++; gives 3 + 4 = 7.

Method: work strictly left to right, writing the value used and the new value of the variable at each step.

Worked example

(2 marks) Give the values of a and b: int a = 5; int b = a++ + ++a;

Try it first, then show the solutionSolution
  1. a++ uses 5, then a = 6; ++a makes a = 7 and uses 7 - 1 mark.
  2. b = 5 + 7 = 12; a = 7 - 1 mark.

Answer: a = 7, b = 12

Precedence and associativity

Precedence (hierarchy) decides which operator is applied first when an expression has several. Associativity decides the order when operators of the same precedence appear together.

Order used in ICSE (highest first):
1. ( ) brackets, . dot, postfix ++ --
2. Unary: prefix ++ --, unary + −, ! (right to left)
3. * / % (left to right)
4. + − (left to right)
5. < <= > >=
6. == !=
7. &&
8. ||
9. ?: (right to left)
10. = += −= *= /= %= (right to left)

Examples (as run in this study guide):

  • 2 + 3 * 4 = 14 (multiplication first); (2 + 3) * 4 = 20.
  • 10 − 4 − 3 = 3 (left to right: 6 − 3).
  • 100 / 10 / 2 = 5 (left to right: 10 / 2).
  • 8 / 3 * 3 + 8 % 3 = 2 * 3 + 2 = 8.
  • 10 + 20 + "30" + 40 + 50 prints 30304050: 10 + 20 = 30 first, then everything after the String is joined as text.

Assignment is right to left: a = b = 5 sets b, then a.

Worked example

(2 marks) Evaluate: 8 / 3 * 3 + 8 % 3

Try it first, then show the solutionSolution
  1. * / % have equal precedence, left to right: 8 / 3 = 2; 2 * 3 = 6; 8 % 3 = 2 - 1 mark.
  2. Then + : 6 + 2 = 8 - 1 mark.

Answer: 8

new and dot operators; print() and println()

new operator: creates an object dynamically, that is, allocates memory for it while the program runs, and returns a reference to it.
Student s = new Student();
Scanner sc = new Scanner(System.in);

Dot (.) operator: accesses (invokes) the members of a class or object: s.name, s.show(), Math.sqrt(16), System.out.println().

Output statements:

  • System.out.print(x): prints x and leaves the cursor on the same line.
  • System.out.println(x): prints x and then moves the cursor to the next line. System.out.println(); alone prints a blank line.
  • The + operator joins (concatenates) text with values: "Sum = " + s.

Program (as run in this study guide): splitting seconds with / and %.
class TimeSplit
{
public static void main(String args[])
{
int total = 7384;
int hours = total / 3600;
int rest = total % 3600;
int minutes = rest / 60;
int seconds = rest % 60;
System.out.println(total + " seconds = " + hours + " h " + minutes + " min " + seconds + " s");
}
}
Output: 7384 seconds = 2 h 3 min 4 s

Worked example

(2 marks) What is the role of the new operator in Student s = new Student(); and of the dot operator in s.show();?

Try it first, then show the solutionSolution
  1. new allocates memory for a Student object at run time and returns its reference, stored in s - 1 mark.
  2. The dot operator accesses the member method show() of the object s - 1 mark.

Answer: new creates a Student object in memory during execution and returns its reference, which is stored in s. In s.show(); the dot operator invokes the method show() belonging to the object s.

Operators in Java in real life

Each concept, met in an everyday situation. Read the situation, answer the question in your own words, then compare with the model answer. The one-line hook is what to remember.

Counter and accumulator

Suppose a shopkeeper keeps a tally of how many customers came and the total sales: three customers spend Rs 15, Rs 25 and Rs 35.

Model this with a counter and an accumulator and find the average spend.

Try it first, then show the solutionSolution
  1. count increases by 1 per customer: 3.
  2. sum adds each bill: 15 + 25 + 35 = 75.
  3. Average = (double) sum / count = 25.0.

Answer: count = 3 (counter), sum = 75 (accumulator), average spend Rs 25.0.

Memory hook: Count adds one; sum adds the amount.

Integer division and modulus

Imagine 7384 seconds of video and you need to show the length as hours, minutes and seconds.

How do / and % split it?

Try it first, then show the solutionSolution
  1. 7384 / 3600 = 2 hours (integer division).
  2. 7384 % 3600 = 184 seconds left; 184 / 60 = 3 minutes.
  3. 184 % 60 = 4 seconds.

Answer: 2 h 3 min 4 s: / gives how many whole units fit, % gives what is left over.

Memory hook: Divide for whole units, mod for the leftovers.

Short-circuit AND

Suppose a lift checks 'is the door closed AND is the load under the limit?' before moving.

If the door is open, does the lift need to weigh the load? How does Java's && behave the same way?

Try it first, then show the solutionSolution
  1. AND needs both conditions true.
  2. If the first is false, the result is false whatever the second is.
  3. Java's && skips evaluating the second condition when the first is false.

Answer: No. Once the door check fails, the answer is already false, so the load check is skipped; Java's && short-circuits in the same way.

Memory hook: AND stops at the first false; OR stops at the first true.

Topics in this chapter

Operators in Java: syntax and key facts

Forms
Unary (1 operand): ++ -- ! −; binary (2): + − * / % < == && =; ternary (3): ?:
condition ? a : b
Prefix vs postfix
++a: change then use; a++: use then change
Trace left to right.
Shorthand
a op= b means a = a op (b)
i *= 2 + 3 → i = i * 5.
Precedence (high to low)
  1. 1.() . postfix
  2. 2.unary ! ++ --
  3. 3.* / %
  4. 4.+ −
  5. 5.< > <= >=
  6. 6.== !=
  7. 7.&&
  8. 8.||
  9. 9.?:
  10. 10.= op=
Same level: left to right (except unary, ?:, assignment).
Integer rules
int / int = int (fraction dropped); a % b has the sign of a
7 / 2 = 3; −17 % 5 = −2.

How the school exam asks Operators in Java

The question patterns to expect, and the method that works for each.

Question typeHow it is askedMethod
MCQ and assertion-reason (1 mark)Type of an operator; result of a % expression; which operator is ternary; precedence order.Count operands for the form; apply the precedence table.
Output and evaluation (2 marks)Find a and b after prefix/postfix expressions; evaluate mixed expressions; short-circuit traces.Write the value used and the new value at each step.
Rewrite (2 marks)Rewrite with the ternary operator or with shorthand operators; write Java expressions.condition ? x : y; a += b.
Program (15 marks)Programs using / and % (time, money, digits), relational and logical operators and ?:.Integer division for whole units; % for remainders; clear output labels.

Tricks to remember Operators in Java

Short memory aids. Say each one aloud once, then use it on a question the same day.

  • Pre = Prepare first

    Prefix: prepare (change) the value first, then use it; postfix: post (after) use, change.

    Use it when: Prefix vs postfix.

  • BUMA RELAT

    Brackets, Unary, Multiplicative, Additive, RElational, Logical (&& before ||), Assignment Too.

    Use it when: Precedence order.

  • Mod takes the left sign

    The sign of a % b follows a.

    Use it when: Negative modulus.

Operators in Java: exam-level solved questions

Ordered from exam level to HOTS. Cover the solution, write your own, then compare step by step.

Example 1: Ternary operator · 1 mark · MCQExam level

Which of the following is a ternary operator in Java?
(a) &&
(b) ?:
(c) ++
(d) %

Try it first, then show the solutionSolution
  1. && and % are binary; ++ is unary.
  2. ?: takes three operands.

Answer: (b) ?:

Example 2: Assertion and reason: shorthand with char · 1 mark · Assertion-reasonHarder exam level

Assertion (A): char ch = 'a'; ch += 2; compiles and makes ch equal to 'c'.
Reason (R): Shorthand assignment operators perform an automatic cast to the type of the left operand.
(a) Both A and R are true and R is the correct explanation of A
(b) Both A and R are true but R is not the correct explanation of A
(c) A is true but R is false
(d) A is false but R is true

Try it first, then show the solutionSolution
  1. ch += 2 is compiled as ch = (char) (ch + 2): 'c'.
  2. R explains A (ch = ch + 2 alone would not compile).

Answer: (a) Both A and R are true and R is the correct explanation of A

Example 3: Prefix and postfix trace · 2 marks · Very short answerHarder exam level

Give the values of k and y: int k = 4; int y = k-- * 2 + --k;

Try it first, then show the solutionSolution
  1. k-- uses 4, then k = 3; 4 * 2 = 8.
  2. --k makes k = 2 and uses 2; y = 8 + 2 = 10.

Answer: k = 2, y = 10

Example 4: Shorthand with increment · 2 marks · Short answerHOTS / competency

Give the output: int x = 10; x += x++ + --x; System.out.println(x);

Try it first, then show the solutionSolution
  1. x += E means x = x + E; the left x is taken as 10 before E is evaluated.
  2. E: x++ gives 10 (x = 11), --x gives 10 (x = 10); E = 20; x = 10 + 20 = 30.

Answer: 30

Example 5: Short-circuit evaluation · 2 marks · Very short answerHarder exam level

Give the output:
int p = 5;
boolean r = (p > 10) && (++p > 5);
System.out.println(r + " " + p);

Try it first, then show the solutionSolution
  1. p > 10 is false, so && does not evaluate ++p > 5.
  2. r = false and p remains 5.

Answer: false 5

Example 6: Write Java expressions · 2 marks · Very short answerExam level

Write Java expressions for: (i) the average of a, b and c as a decimal; (ii) 'n is a two-digit number'; (iii) s = ut + ½at².

Try it first, then show the solutionSolution
  1. (i) (a + b + c) / 3.0 (ii) n >= 10 && n <= 99
  2. (iii) s = u * t + 0.5 * a * t * t (or 1.0 / 2 * a * t * t; 1 / 2 would give 0).

Answer: (i) (a + b + c) / 3.0 (ii) n >= 10 && n <= 99 (iii) s = u * t + 0.5 * a * t * t

Example 7: Seconds to hours, minutes and seconds · 15 marks · Long answerHarder exam level

Write a program that stores 7384 seconds and prints it as hours, minutes and seconds using / and %. Then print whether it is more than 2 hours (hours > 2 || (hours == 2 && rest > 0)) and use the ternary operator to print 'Long' if total > 3600, otherwise 'Short'.

Try it first, then show the solutionSolution
  1. class TimeSplit
    {
    public static void main(String args[])
    {
    int total = 7384;
    int hours = total / 3600;
    int rest = total % 3600;
    int minutes = rest / 60;
    int seconds = rest % 60;
  2. System.out.println(total + " seconds = " + hours + " h " + minutes + " min " + seconds + " s");
  3. boolean overTwo = hours > 2 || (hours == 2 && rest > 0);
    System.out.println("More than 2 hours? " + overTwo);
  4. String size = (total > 3600) ? "Long" : "Short";
    System.out.println("Category: " + size);
    }
    }
  5. Trace: 7384 / 3600 = 2; 7384 % 3600 = 184; 184 / 60 = 3; 184 % 60 = 4; 2 > 2 is false, but 2 == 2 && 184 > 0 is true, so overTwo is true; 7384 > 3600 gives Long.

Answer: Output (as run):
7384 seconds = 2 h 3 min 4 s
More than 2 hours? true
Category: Long

Case-study practice (Section B style)

Read the situation, then answer every part. In a school exam set on the board pattern this is a 7-mark question split into 3 + 2 + 2 marks.

Tracing a tricky expression

Imagine Meera's teacher writes three statements on the board:
int e = 2;
e = e * e++ + ++e;
System.out.println(10 + 20 + "30" + 40 + 50);
int u = 6, v = 4;
u = u + v; v = u - v; u = u - v;

  1. (i) · 3 marks

    Find the final value of e, showing each step.

    Answer

    Answer: e * e++ : e is 2, e++ uses 2 (e becomes 3): 2 * 2 = 4. ++e makes e 4 and uses 4. e = 4 + 4 = 8.

    1 mark per correct step; final 8.

  2. (ii) · 2 marks

    What does the println statement print? Explain.

    Answer

    Answer: 30304050. 10 + 20 = 30 is added first (both numbers); then "30" makes the rest string joining: "30" + "30" + "40" + "50".

    1 mark output, 1 mark reason.

  3. (iii) · 2 marks

    What are u and v after the last line? What does this code do?

    Answer

    Answer: u = 4, v = 6. It swaps the values of two variables without a third variable (u = 10; v = 10 − 4 = 6; u = 10 − 6 = 4).

    1 mark values, 1 mark purpose.

Where the marks are

How a typical answer is split into step marks. Show every step: a right final answer alone rarely earns full marks.

Find the values of a and b: int a = 5; int b = a++ + ++a; (2 marks) (2 marks)

StepMarks
a++ uses 5 (a becomes 6); ++a gives 7.1
b = 12, a = 7.1

Program: split seconds into hours, minutes and seconds with a ternary category. (15 marks) (15 marks)

StepMarks
Class, main() and variable declarations.2
hours = total / 3600 and rest = total % 3600.3
minutes = rest / 60 and seconds = rest % 60.3
Logical expression with || and && and its output.3
Ternary operator and labelled output.4

Where students lose marks in Operators in Java

The slips examiners see most often, and what to write instead.

  • Mistake: Using the new value in a postfix expression

    Prefix and postfix confused.

    Wrong working

    int a = 5; b = a++ * 2; gives b = 12

    Right working

    a++ uses 5 first: b = 10, then a = 6.

    Do this: Postfix: use, then change.

    Usually costs: 1 to 2 marks.

  • Mistake: Ignoring integer division

    Expecting decimals from int operands.

    Wrong working

    7 / 2 = 3.5

    Right working

    7 / 2 = 3; 7 / 2.0 = 3.5

    Do this: If both operands are int, the result is int.

    Usually costs: 1 mark.

  • Mistake: Evaluating string joins numerically throughout

    + has two meanings.

    Wrong working

    10 + 20 + "30" + 40 prints 100

    Right working

    Prints 303040: numbers add until a String appears, then everything joins.

    Do this: Work left to right and switch to joining after the first String.

    Usually costs: 1 mark.

  • Mistake: Writing bitwise & or | for logical AND/OR

    Single symbols look similar.

    Do this: Use && and || in conditions; bitwise operators are not in the syllabus.

    Usually costs: 1 mark.

Practice questions on Operators in Java

Write each answer on paper first. Open the hint only if you are stuck, and the answer only when you have finished.

  1. Q1 · 1 mark · MCQExam level

    The value of 15 % 4 * 2 is:
    (a) 6
    (b) 1
    (c) 2
    (d) 7

    Hint

    Left to right.

    Answer

    (a) 6 (15 % 4 = 3; 3 * 2 = 6)

  2. Q2 · 1 mark · MCQExam level

    Which operator has the highest precedence among these?
    (a) &&
    (b) +
    (c) !
    (d) ==

    Hint

    Unary.

    Answer

    (c) !

  3. Q3 · 2 marks · Very short answerHarder exam level

    Give the output: int z = 3; z = z++ + z++; System.out.println(z);

    Hint

    3 then 4.

    Answer

    7 (first z++ uses 3, z becomes 4; second uses 4; 3 + 4 = 7 assigned to z).

  4. Q4 · 2 marks · Very short answerHarder exam level

    Give the output: int q = 5; boolean s = (q > 1) || (++q > 5); System.out.println(s + " " + q);

    Hint

    OR stops at the first true.

    Answer

    true 5

  5. Q5 · 2 marks · Very short answerHarder exam level

    Rewrite using shorthand operators: (i) a = a * 4; (ii) b = b % 10; (iii) c = c - (d + 2);

    Hint

    op=

    Answer

    (i) a *= 4; (ii) b %= 10; (iii) c -= d + 2;

  6. Q6 · 2 marks · Short answerHOTS / competency

    Give the output: System.out.println(-7 / 2 + " " + 7 / 2 * 2.0);

    Hint

    Integer division first.

    Answer

    -3 6.0 (−7 / 2 = −3; 7 / 2 = 3, then 3 * 2.0 = 6.0)

  7. Q7 · 2 marks · Very short answerExam level

    Distinguish between = and == with an example.

    Hint

    Assign vs compare.

    Answer

    = is the assignment operator that stores a value (x = 5;). == is a relational operator that compares two values and gives true or false (x == 5).

  8. Q8 · 15 marks · Long answerHarder exam level

    Write a program to store a three-digit number 472 and print the sum of its digits using / and %.

    Hint

    n % 10 gives the last digit.

    Answer

    class DigitSum
    {
    public static void main(String args[])
    {
    int n = 472;
    int units = n % 10;
    int tens = (n / 10) % 10;
    int hundreds = n / 100;
    int sum = units + tens + hundreds;
    System.out.println("Digits: " + hundreds + ", " + tens + ", " + units);
    System.out.println("Sum of digits = " + sum);
    }
    }
    Output (as run):
    Digits: 4, 7, 2
    Sum of digits = 13

  9. Q9 · 2 marks · Short answerHOTS / competency

    A student writes int avg = (m1 + m2 + m3) / 3; for marks 70, 75 and 81 and gets 75. The correct average is 75.33. Explain the error and correct it.

    Hint

    Integer division and type.

    Answer

    Both the sum (226) and 3 are int, so the division drops the fraction, and avg is int anyway. Correct: double avg = (m1 + m2 + m3) / 3.0; which gives 75.33...

Test your recall

Answer in your head or on paper first, then open the card. Pulling an answer out of memory makes it stick far better than re-reading.

  1. 1.Result of 17 % 5?Show answer

    2

  2. 2.Operator that creates an object?Show answer

    new

  3. 3.a += b is short for?Show answer

    a = a + b

  4. 4.Which is evaluated first: && or ||?Show answer

    &&

  5. 5.Number of operands of ?:?Show answer

    Three.

  6. 6.Difference between print() and println()?Show answer

    println() moves to a new line after printing; print() does not.

Best order to study it

  1. Learn forms of operators and the ternary operator.
  2. Learn arithmetic operators, integer division and %.
  3. Learn relational and logical operators with short-circuiting.
  4. Practise prefix and postfix traces daily.
  5. Learn the precedence table; then shorthand, counters, accumulators, new, dot, print and println.

Quick revision checklist

The night before the exam: can you do each of these without looking?

  • Unary (1), binary (2), ternary ?: (3 operands).
  • Arithmetic + − * / %; int / int drops the fraction; % takes the sign of the left operand.
  • Relational give boolean; logical && || ! with short-circuiting.
  • ++a change then use; a++ use then change.
  • Precedence: () → unary → * / % → + − → relational → equality → && → || → ?: → assignment.
  • new creates objects; dot accesses members; print stays, println moves to a new line.

Operators in Java: frequently asked questions

Are bitwise and shift operators examined?

No. The syllabus exempts bitwise and shift operators. Use && and || for conditions.

Will questions like x = x++ + ++x be asked?

Yes, prefix and postfix traces are common. Such code is confusing in real programs, but question papers use it to test exact understanding, so trace left to right carefully.

Is + an arithmetic operator or a string operator?

Both. With two numbers it adds; if either operand is a String, it joins (concatenates) them.

Based on: CISCE ICSE 2028 Computer Applications (86) syllabus (Classes IX and X); CISCE Regulations for ICSE Examination Year 2028