(a) Define Encapsulation.

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

11 Mark · 2016 · Section A · 2016 Paper

(a) Define Encapsulation.

Show SolutionHide Solution↓

Encapsulation is a mechanism that binds together code and the data it manipulates. It keeps them both safe from the outside world, preventing any unauthorised access or misuse. Only member methods, which are wrapped inside the class, can access the data and other methods.

(b) What are keywords ? Give an example.

Keywords are reserved words that have a special meaning to the Java compiler. Example: class, public, int, etc.

(c) Name any two library packages.

Two library packages are:

  1. java.io
  2. java.util

(d) Name the type of error ( syntax, runtime or logical error) in each case given below:

  1. Math.sqrt (36 – 45)
  2. int a;b;c;
  1. Runtime Error
  2. Syntax Error

(e) If int x[] = { 4, 3, 7, 8, 9, 10}; what are the values of p and q ?

  1. p = x.length
  2. q = x[2] + x[5] * x[1]
  1. 6
  2. q = x[2] + x[5] * x[1]
    q = 7 + 10 * 3
    q = 7 + 30
    q = 37
Next question →

Browse the free Computer Applications sample bank