(a) Name any two wrapper classes.

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

21 Mark · 2013 · Section A · 2013 Paper

(a) Name any two wrapper classes.

Show SolutionHide Solution↓

Two wrapper classes are:

  1. Integer
  2. Character

(b) What is the difference between a break statement and a continue statement when they occur in a loop?

When the break statement gets executed, it terminates its loop completely and control reaches to the statement immediately following the loop. The continue statement terminates only the current iteration of the loop by skipping rest of the statements in the body of the loop.

(c) Write statements to show how finding the length of a character array char[] differs from finding the length of a String object str.

Java code snippet to find length of character array:

char ch[] = {'x', 'y', 'z'};
int len = ch.length

Java code snippet to find length of String object str:

String str = "Test";
int len = str.length();

(d) Name the Java keyword that:

  1. indicates that a method has no return type.
  2. stores the address of the currently-calling object.
  1. void
  2. this

(e) What is an exception?

An exception is an abnormal condition that arises in a code sequence at run time. Exceptions indicate to a calling method that an abnormal condition has occurred.

← Previous questionNext question →

Share on WhatsApp

Browse the free Computer Applications sample bank