0% found this document useful (0 votes)
14 views

Methods

The document is a worksheet for Class X on computer applications, specifically focusing on methods in programming. It contains multiple-choice questions covering topics such as static data members, method definitions, return types, method overloading, and parameter passing techniques. The questions are designed to test the understanding of key programming concepts and Java features.

Uploaded by

sumanpratham5555
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Methods

The document is a worksheet for Class X on computer applications, specifically focusing on methods in programming. It contains multiple-choice questions covering topics such as static data members, method definitions, return types, method overloading, and parameter passing techniques. The questions are designed to test the understanding of key programming concepts and Java features.

Uploaded by

sumanpratham5555
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

COMPUTER APPLICATIONS

METHODS WORKSHEET 1
CLASS X
1. A static data member has …………. for all objects of a class.
a) multiple copies b)single copy c) arranged copy d)unsorted copy

2. What is the first line of method definition called?


a) body b) definition c) prototype d) overloading

3. Method name is an example of:


a) identifier b) keyword c) data type d) literal

4. What is the return type of a method that does not return a value?
a) double b) int c) float d) void

5. Identify the instance and local variables in the following code snippet:
class var
{ int p, q;
var( int n, int m )
{ p = n;
q = m; } }
a) instance n, m local p, q c) instance m local q
b) instance p, q local n, m d) instance n local p

6. What is the process of defining more than one method with same name in a class
differentiated by method signature called?
a) method overloading b) method overriding c) defining method d) calling method

7. The prototype of a function Show() that returns a float value and takes two integer values as
parameter is :
a) public void Show(int a, int b) c) public float Show(int a)
b) public void Show(int b) d) public float Show(int a, int b)

8. The keyword that transfer the control back to the method call:
a) Throws b ) return c) send d) back

9. ......................is implemented in java using function overloading.


a) Abstraction b) Inheritance c) Polymorphism d) Encapsulation

10. How many values can a function return?


a) 1 value b) 2 values c) 3 values d) no value

11. A method that does not return a value has a ....................return type.
a) double b) class c)float d) void

12. If a method returns a value, then it must be .................. .


a) of the same data type as defined in its prototype b) void type
c) double type d) boolean type

13. The parameters that are passed to the method when it is invoked are called .................
a) actual parameters c) formal parameters
b) informal parameters d) void parameters

14. The method that changes the state of an object is known as ............. .
a) pure method b) impure method c) perfect method d) imperfect method
15. The technique in which the change in the formal parameter gets reflected in the actual
parameter is known as ........................ .
a) call by reference b) call by value c) call by argument d) call by method

16. In which technique are the values of actual parameters copied to the formal parameters?
a) call by reference b) call by value c) call by argument d) call by method

17. A method with many definitions is known as ................ .


a) many method b) multiple method c) void method d) overloaded method

18. Which of the following keywords are used to control access to a class Member
a) default
b) Interface
c) Abstraction
d) protected

19. A function that modifies its parameters is called


a) Modifier b) Impure Function c) Pure Function d) Virtual function

20. The technique in which the values of actual parameters are copied to the formal
parameters
a) Call by value b. Call by argument c. call by reference d. Call by method

21. Which feature of Java does his picture represent.

You might also like