0% found this document useful (0 votes)
28 views3 pages

Java Methods Overloading MCQs ICSE

The document contains 50 multiple-choice questions (MCQs) focused on methods and method overloading in Java, aligned with the ICSE syllabus. Each question is numbered and includes a question along with its corresponding answer option. The content covers various aspects of Java methods, including return types, method parameters, and the principles of method overloading.

Uploaded by

ravibhengra11
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)
28 views3 pages

Java Methods Overloading MCQs ICSE

The document contains 50 multiple-choice questions (MCQs) focused on methods and method overloading in Java, aligned with the ICSE syllabus. Each question is numbered and includes a question along with its corresponding answer option. The content covers various aspects of Java methods, including return types, method parameters, and the principles of method overloading.

Uploaded by

ravibhengra11
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

50 MCQs on Methods & Method Overloading in

Java (ICSE Syllabus)


Q.No Question Answer

1 1. Which keyword is used to define a method in Java? D

2 2. What is the default return type of a method if not specified? B

3 3. Which of the following method headers is valid in Java? C

4 4. A method declared with void return type: C

5 5. Methods in Java are always defined: A

6 6. The variables passed in the method definition are called: B

7. What will be the output?


7 void test() { System.out.println("Hello ICSE"); } B

8 8. Which of these is true about method parameters in Java? B

9 9. What does the return statement do in a method? B

10 10. A method that returns an integer must have return type: B

11 11. Which method is executed automatically when a Java program starts? C

12 12. Methods with the same name as the class but without return type are called: B

13. What will be the output?


13 void show(int x) { System.out.println(x); } show(25); A

14 14. A method can return: C

15 15. In Java, the main() method must always be: A

16 16. Method overloading in Java means: A

17 17. Which of the following is not a valid way to overload a method? D

18. What will be the output?


void display(int a) { System.out.println("int"); }
void display(double a) { System.out.println("double"); }
18 display(10); A

19 19. Which of the following can not differentiate overloaded methods? C

20 20. If two overloaded methods have the same parameters but different return types, then:
B

21 21. Which is a valid overloaded method of sum(int a, int b)? D

22. What will be the output?


void test(int a) { System.out.println("One"); }
void test(int a, int b) { System.out.println("Two"); }
22 test(5); A

23 23. Which of the following statements is true? C

24 24. Which of the following is false? C

25. What will be the output?


void print(String s) { System.out.println("String"); }
void print(Object o) { System.out.println("Object"); }
25 print("Hello"); A

26 26. What is the main advantage of method overloading? B


27 27. In method overloading, decision of which method to call is made at: A

28 28. Which of the following shows constructor overloading? B

29. Which overloaded method will be invoked?


void show(int x) { System.out.println("int"); }
void show(long x) { System.out.println("long"); }
29 show(20); A

30 30. Which of these is not allowed in method overloading? A

31 31. Can methods in Java be overloaded based only on different return type? B

32. What is the output?


void calc(float x) { System.out.println("float"); }
void calc(double x) { System.out.println("double"); }
32 calc(10.5); B

33. Which overloaded version of max() will be called?


int max(int a, int b) { return (a > b) ? a : b; }
double max(double a, double b) { return (a > b) ? a : b; }
33 max(5, 6); A

34 34. In method overloading, two methods must differ by: C

35 35. Which of the following is correct about method overloading? A

36. What will be the output?


void show(char x) { System.out.println("char"); }
void show(int x) { System.out.println("int"); }
36 show('A'); A

37. Which overloaded method will run?


void demo(long a) { System.out.println("long"); }
void demo(float a) { System.out.println("float"); }
37 demo(100); B

38 38. Method signature in Java consists of: B

39 39. Can the main() method be overloaded in Java? A

40 40. Which method call is valid for: void add(int a, double b) { } A

41. What is the output?


void calc(int a, int b) { System.out.println("int int"); }
void calc(double a, double b) { System.out.println("double double"); }
41 calc(5, 10); C

42 42. A method is uniquely identified in Java by: C

43. Which overloaded version will be called?


void test(byte b) { System.out.println("byte"); }
void test(short s) { System.out.println("short"); }
43 test(5); A

44 44. Can a method be overloaded by changing only the access specifier? B

45. Which overloaded method will be chosen?


void show(int a, double b) { System.out.println("int double"); }
void show(double a, int b) { System.out.println("double int"); }
45 show(10, 20); C

46 46. Which is true about method overloading? D


47. What is the output?
void fun(int a) { System.out.println("int"); }
void fun(float a) { System.out.println("float"); }
47 fun('A'); A

48. Which overloaded method will be called?


void display(int... a) { System.out.println("varargs"); }
void display(int a) { System.out.println("int"); }
48 display(5); B

49 49. Method overloading is an example of: C

50 50. Which of these is not true for method overloading? B

You might also like