ICSE Class X Computer Applications ( Java ) Solved Model Question Papers 01

Question 1.
a.       Define Encapsulation.
Ans: The wrapping of data and function together into a single unit is called Encapsulation.
b.      Name any two OOP’s principles
Ans: Inheritance and Polymorphism
c.       Define Object with an example.
Ans:  Object: An instance of a class called Object. The table is an instance of class Furniture.
Class: Blue print of an object is called Class. Example, mango, apple, and orange are members of the class fruit.
d.      What is wrapper class? Give example.
e.      A wrapper class is a class which wraps a primitive data type. Example Double, Float, Integer

Question 2.
a.       What is a class variable?
Ans: Instance variables having the keyword static before it is a class variable. For every object, there is just one copy of the variable made.
b.      What is the significance of import java.io.* in your program?
Ans: The line imports all the classes of the java.io package into the current program.
c.       State the two kinds of data types.
Ans: The two kinds of data types in Java are primitive and reference data types.
d.      Define impure function.
Ans: Impure Function: A function that brings about a change in the argument that it receives. Its arguments will always be reference types. It may or may not return value. In other words, an impure function brings about a change in the state of the function. This change in state is called the side effect of calling an impure function.
Example:
Static void count(Number num) 
{
        num.counter=num.counter+1;
}
e.      What are comments? Name the different types.
Ans: Comments are statements which enhance the readability and understanding of the program. They are not part of the program.
The different types are: single line (//….), multiple line (/* … */) and documenting comment (/**….*/).

No comments:

Post a Comment