(a) What is the difference between an object and a class?

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

11 Mark · 2011 · Section A · 2011 Paper

(a) What is the difference between an object and a class?

Show SolutionHide Solution↓

A class is a blue print that represents a set of objects that share common characteristics and behaviour whereas an object is a specific instance of a class having a specific identity, specific characteristics and specific behaviour.

(b) What does the token 'keyword' refer to in the context of Java? Give an example for keyword.

Keywords are reserved words that have a special meaning for the Java compiler. Java compiler reserves these words for its own use so Keywords cannot be used as identifiers. An example of keyword is class.

(c) State the difference between entry controlled loop and exit controlled loop.

Entry controlled loopExit controlled loop
It checks the condition at the time of entry. Only if the condition is true, the program control enters the body of the loop.It checks the condition after executing its body. If the condition is true, loop will perform the next iteration otherwise program control will move out of the loop.
Loop does not execute at all if the condition is false.The loop executes at least once even if the condition is false.
Example: for and while loopsExample: do-while loop

(d) What are the two ways of invoking functions?

Two ways of invoking functions are:

  1. Pass by value.
  2. Pass by reference.

(e) What is the difference between / and % operators?

/%
Division operatorModulus operator
Returns the quotient of division operationReturns the remainder of division operation
Example: int a = 5 / 2; Here a will get the value of 2 which is the quotient of this division operationExample: int b = 5 % 2; Here b will get the value of 1 which is the remainder of this division operation
Next question →

Browse the free Computer Applications sample bank