(a) Operators with higher precedence are evaluated before operators with relatively lower precedence. Arrange the operators given below in order of higher…

ICSE Class 10 Computer Applications PYQ · 2014 Paper · Section A

21 Mark · 2014 · Section A · 2014 Paper

(a) Operators with higher precedence are evaluated before operators with relatively lower precedence. Arrange the operators given below in order of higher precedence to lower precedence:

Show SolutionHide Solution↓

++
%
>=
&&

(b) Identify the statements listed below as assignment, increment, method invocation or object creation statements.

  1. System.out.println("Java");
  2. costPrice = 457.50;
  3. Car hybrid = new Car();
  4. petrolPrice++;
  1. Method Invocation
  2. Assignment
  3. Object Creation
  4. Increment

(c) Give two differences between the switch statement and the if-else statement

switchif-else
switch can only test if the expression is equal to any of its case constantsif-else can test for any boolean expression like less than, greater than, equal to, not equal to, etc.
It is a multiple branching flow of control statementIt is a bi-directional flow of control statement

(d) What is an infinite loop? Write an infinite loop statement.

A loop which continues iterating indefinitely and never stops is termed as infinite loop. Below is an example of infinite loop:

for (;;)
    System.out.println("Infinite Loop");

(e) What is constructor? When is it invoked?

A constructor is a member method that is written with the same name as the class name and is used to initialize the data members or instance variables. A constructor does not have a return type. It is invoked at the time of creating any object of the class.

← Previous questionNext question →

Browse the free Computer Applications sample bank