INTRODUCTION
The User-Defined Method is an important chapter from Computer Applications. It is under ICSE 2022 Computer Applications syllabus.
In this article, I have shared with you the important MCQs from the User-Defined Methods. Please read the questions carefully and try finding their answers, and then look for the given answers.
Important MCQ from the User-Defined Methods :
Q1. Which of the following Java keyword indicates that a method has no return type?
a. null
b. void
c. private
d. return
ANSWER: b
Q2. Which of the following functions (methods) do not change the state of an object?
a. Impure function
b. Pure function
c. Reserved function
d. Both b & c
ANSWER: b
Q3. What shall be written in the blank to illustrate function overloading?
max(int a, int b)
____ (double i, double b)
a. area
b. max
c. class name
d. we can give any name
ANSWER: b
Q4. How are the reference types passed in Java?
a. By value
b. By reference
c. By dot operator
d. Cannot say
Answer: b
Q5. Formal parameters are also known as:
a. Standard parameters
b. Virtual parameters
c. Tertiary parameters
d. Dummy parameters
ANSWER : d
Q6. The parameters that appear in the method call are called ______ parameters.
a. Actual
b. Formal
c. Partial
d. Both a & b
ANSWER: a
Q7. If a function contains six return statements, how many of them will be executed?
a. All the above
b. none of the statements
c. 3 statements
d. Only one
Answer : d
Q8. Choose the values of p after the execution of the following function?
The values passed are 10 & 20
void func(int p, intq)
{
p=p*q;
q=p*q;
p=p*q;
System.out.println(p+" ,"+b);
}
a. 800000
b. 750000
c. 480000
d. 530000
ANSWER: a
Q9. Which of the following is the reference data type?
a. char
b. boolean
c. arrays
d. long
ANSWER: c
Q10. Name the return type of the main() method?
a. void
b. static
c. int
d. Any data type
ANSWER: a
Q11. Will the impure methods return the same when the same arguments are given?
a. Yes
b. No
c. Wrong Question
d. Cannot say
ANSWER: b
Q12. The String objects are _____ in Java.
a. Mutable
b. Immutable
c. Invalid
d. Arguments
ANSWER: b
Q13. If the strings are passed by reference, can they be changed?
a. Yes
b. No
c. Incorrect question
d. Cannot say
Answer: b
Q14. Fill in the blanks:
MyFunc obj = new ______;
a. Myfunc()
b. class name
c. MyFunc()
d. Both b & c
Answer: c
Q15. A method is a named block of code within a ______.
a. Function
b. Scope
c. Class
d. Both b & c
Answer: c
So, these were the most important MCQs from the User-Defined Methods, ICSE Class 10. If you find these questions important, please share it with your friends. If you have any queries, tell me in the comments.
INTRODUCTION
The User-Defined Method is an important chapter from Computer Applications. It is under ICSE 2022 Computer Applications syllabus.
In this article, I have shared with you the important MCQs from the User-Defined Methods. Please read the questions carefully and try finding their answers, and then look for the given answers.
Important MCQ from the User-Defined Methods :
Q1. Which of the following Java keyword indicates that a method has no return type?
a. null
b. void
c. private
d. return
ANSWER: b
Q2. Which of the following functions (methods) do not change the state of an object?
a. Impure function
b. Pure function
c. Reserved function
d. Both b & c
ANSWER: b
Q3. What shall be written in the blank to illustrate function overloading?
max(int a, int b)
____ (double i, double b)
a. area
b. max
c. class name
d. we can give any name
ANSWER: b
Q4. How are the reference types passed in Java?
a. By value
b. By reference
c. By dot operator
d. Cannot say
Answer: b
Q5. Formal parameters are also known as:
a. Standard parameters
b. Virtual parameters
c. Tertiary parameters
d. Dummy parameters
ANSWER : d
Q6. The parameters that appear in the method call are called ______ parameters.
a. Actual
b. Formal
c. Partial
d. Both a & b
ANSWER: a
Q7. If a function contains six return statements, how many of them will be executed?
a. All the above
b. none of the statements
c. 3 statements
d. Only one
Answer : d
Q8. Choose the values of p after the execution of the following function?
The values passed are 10 & 20
void func(int p, intq)
{
p=p*q;
q=p*q;
p=p*q;
System.out.println(p+" ,"+b);
}
a. 800000
b. 750000
c. 480000
d. 530000
ANSWER: a
Q9. Which of the following is the reference data type?
a. char
b. boolean
c. arrays
d. long
ANSWER: c
Q10. Name the return type of the main() method?
a. void
b. static
c. int
d. Any data type
ANSWER: a
Q11. Will the impure methods return the same when the same arguments are given?
a. Yes
b. No
c. Wrong Question
d. Cannot say
ANSWER: b
Q12. The String objects are _____ in Java.
a. Mutable
b. Immutable
c. Invalid
d. Arguments
ANSWER: b
Q13. If the strings are passed by reference, can they be changed?
a. Yes
b. No
c. Incorrect question
d. Cannot say
Answer: b
Q14. Fill in the blanks:
MyFunc obj = new ______;
a. Myfunc()
b. class name
c. MyFunc()
d. Both b & c
You must be logged in to post a comment.