icseboard.org

ICSE Class 10 Computer MCQ Solutions: Chapter 1 Java

ICSE Class 10 Computer MCQ Solutions

ICSE Class 10 Computer MCQ solutions in this chapter help you revise Java concepts such as method signatures, parameters, wrapper classes, arrays, String methods and sorting. Each answer gives the correct option first and then explains the reason, so you can prepare for competency-based Computer Applications questions without memorising options blindly.

How to use these competency MCQ solutions

Read each ICSE Computer Applications MCQ in three steps: identify the Java topic, test the rule on a small example, and then choose the option. This method is safer than matching keywords because many options look similar but differ in case, parameter order or return type.

For syllabus alignment, check the Computer Applications subject requirements on the CISCE official website. For more practice on the same site, use the ICSE Class 10 Computer Applications study guide, the ICSE Class 10 Computer Applications previous year papers and the ICSE Class 10 syllabus page.

Concept snapshot: think like the compiler

A Java MCQ is often a compiler check in disguise. Ask: Will the compiler understand this statement before the program runs? If no, it is a syntax or compile-time error. If the statement compiles but fails when a value is used, it is a run time error. If it runs but gives a wrong result, it is a logical error.

Java method, array and String reference

ConceptRule to rememberExample
Method signatureIn Java, the method signature is formed by the method name and parameter list. Two methods in the same class cannot have the same signature.sum(int a, int b)
Formal parameterVariable written in the method definition to receive a value.void show(int n)
Actual parameterValue or variable passed during a method call.show(5)
Array indexJava arrays are zero-indexed. For length n, the highest valid index is n - 1.Length 100 means highest index 99.
String method namesJava is case-sensitive. Built-in method names must match exact spelling and letter case."RESPECT".toLowerCase()
Wrapper conversionWrapper object to primitive is unboxing. Primitive to wrapper is autoboxing.Integer to int is unboxing.

Chapter 1 Multiple Choice Questions: solved answers

The following ICSE Computer Applications solved competency questions cover the Chapter 1 multiple-choice section supplied for this page. The explanations are written for revision, not copied from any solution key.

Question 1: Same method signature in two methods

Question: What type of error occurs when two methods in the same class have the same method signature?

Correct answer: Syntax error.

Reason: Java must be able to identify which method is being called. A method signature depends on the method name and parameter list. If two methods in the same class have the same name and the same parameter list, the compiler cannot treat them as separate overloaded methods.

  1. Same method name: yes.
  2. Same parameter types in the same order: yes.
  3. Duplicate method signature in the same class: invalid.

Final answer: Syntax error.

Question 2: Advantages of user-defined methods

Question: The advantages of user-defined methods are: (i) Reusability, (ii) Complexity, (iii) Modularity.

Correct answer: (i) and (iii).

Reason: A user-defined method lets a programmer write a task once and call it many times. This gives reusability. It also divides a large program into smaller named units, which gives modularity. Complexity is not an advantage; methods are used to reduce and manage complexity.

Final answer: Reusability and modularity.

Question 3: Parameter that receives values

Question: Parameters that receive values during a method call are called what?

Correct answer: Formal parameters.

Reason: In a method definition, the variables written inside the brackets are formal parameters. They receive values when the method is called. The values supplied in the call are actual parameters.

Example: In void display(int a), a is a formal parameter. In display(20), 20 is the actual parameter.

Final answer: Formal parameters.

Question 4: Valid method prototype

Question: Which is a valid method prototype: public int perform (int a; int b), public perform (int a, int b), public int perform (int a, int b), or public perform int (int a, int b)?

Correct answer: public int perform (int a, int b).

Reason: A Java method header follows this order: access modifier, return type, method name and parameter list. Parameters are separated by commas, not semicolons.

  1. public is the access modifier.
  2. int is the return type.
  3. perform is the method name.
  4. (int a, int b) is the parameter list.

Final answer: public int perform (int a, int b).

Question 5: Correct method invocation

Question: Which statement correctly invokes int display(int a, char ch)?

Correct answer: int m = display(45, 'A');

Reason: The method expects two arguments in order: first an int, then a char. The return type is int, so assigning the returned value to an integer variable is valid.

  1. 45 is an integer.
  2. 'A' is a character literal.
  3. The order matches int a, char ch.

Final answer: int m = display(45, 'A');

Question 6: Convert RESPECT to lowercase

Question: Which Java statement converts the word RESPECT to lowercase?

Correct answer: "RESPECT".toLowerCase();

Reason: The method name is toLowerCase(). Java is case-sensitive, so tolowercase() is wrong. The method is called on the String object using the dot operator.

Final answer: "RESPECT".toLowerCase();

Question 7: Wrapper classes

Question: Which are wrapper classes: Boolean, boolean, character, Character?

Correct answer: Boolean and Character.

Reason: Primitive data types use lowercase names, such as boolean and char. Wrapper classes are class names and begin with uppercase letters, such as Boolean and Character.

Final answer: (i) and (iv).

Question 8: Wrapper class to primitive type

Question: Conversion of a wrapper class object to its corresponding primitive type is known as what?

Correct answer: Unboxing.

Reason: Unboxing extracts the primitive value from its wrapper object. For example, an Integer object can be converted to an int value. Autoboxing is the reverse process, where a primitive value is converted into its wrapper object.

Final answer: Unboxing.

Question 9: String method that returns only a positive integer

Question: Which String method results only in a positive integer: indexOf, lastIndexOf, compareTo, or length?

Correct answer expected in the MCQ: length().

Reason: The length() method returns the number of characters in a string. For a non-empty string, this value is positive. By contrast, indexOf() and lastIndexOf() return -1 when the searched character or substring is not found. The compareTo() method can return a negative value, zero or a positive value.

Teacher’s note: Strictly in Java, "".length() returns 0, so the safer statement is that length() returns a non-negative integer. In this ICSE MCQ, it is still the intended answer because the other methods can return negative values.

Final answer: length().

Question 10: Convert String to double

Question: Which method converts a String value to double?

Correct answer: Double.parseDouble(String).

Reason: Double is the wrapper class for the primitive type double. Its static method parseDouble() converts a numeric string into a primitive double.

Example: double x = Double.parseDouble("45.6"); stores the value 45.6 in x.

Final answer: Double.parseDouble(String).

Question 11: Error in System.out.println(x[x.length])

Question: What happens when System.out.println(x[x.length]); is executed?

Correct answer: Run time error.

Reason: If an array has length n, the valid index positions are from 0 to n - 1. The expression x.length gives n. Therefore, x[x.length] tries to access index n, which is outside the array.

  1. Suppose x.length = 5.
  2. Valid indices are 0, 1, 2, 3, 4.
  3. x[5] is outside the array.

Final answer: Run time error, specifically an array index out of bounds error.

Question 12: Valid character array declaration

Question: Which declaration stores the gender of 80 employees as characters?

Correct answer: char gender[] = new char[80];

Reason: The variable must be an array of char values, and memory must be created for 80 elements. The square brackets show that gender is an array. The expression new char[80] creates the 80 storage locations.

Final answer: char gender[] = new char[80];

Question 13: Correct order to accept values into an array

Question: Arrange these statements to accept values into array a[]: a[i] = sc.nextInt();, int a[] = new int[10];, Scanner sc = new Scanner(System.in);, for(i = 0; i < 10; i++).

Correct answer: (ii), (iii), (iv), (i).

Reason: First create the array. Then create the Scanner object for input. Next start the loop so each array position is visited. Inside the loop, read one integer and store it in a[i].

  1. int a[] = new int[10];
  2. Scanner sc = new Scanner(System.in);
  3. for(i = 0; i < 10; i++)
  4. a[i] = sc.nextInt();

Teacher’s note: In a full Java program, i must already be declared, or the loop should be written as for(int i = 0; i < 10; i++).

Final answer: (ii), (iii), (iv), (i).

Question 14: Bubble sort inner loop operation

Question: In bubble sort, during each iteration of the inner loop, two adjacent elements are what?

Correct answer: Compared and swapped.

Reason: Bubble sort checks adjacent elements. If they are in the wrong order for the required sorting direction, the program swaps them. This repeated comparison and swapping moves the larger element towards the end in ascending order.

Final answer: (i) compared and (ii) swapped.

Question 15: Highest index in an array of 100 elements

Question: What is the highest index of an array with 100 elements?

Correct answer: 99.

Reason: Java array indexing starts at 0. Therefore, an array with 100 elements has positions 0 through 99.

Step check: Highest index = length − 1 = 100 - 1 = 99.

Final answer: 99.

Question 16: Dividing a program into simple methods

Question: An event manager divides work among subordinates. In a program, a task is divided into simple methods. Which feature is used?

Correct answer: Modularity.

Reason: Modularity means dividing a large task into smaller modules. In Java programs, methods act as modules because each method can handle one well-defined task.

Final answer: Modularity.

Worked examples for Java MCQ logic

These examples show how to solve new competency MCQs using the same reasoning.

Worked example 1: Method overloading or duplicate method?

Question: Are these two methods valid in the same class?

void print(int a)
void print(int b)

Step 1: Compare method names. Both are named print.

Step 2: Compare parameter lists. Both have one int parameter.

Step 3: Parameter variable names do not make a new method signature. So int a and int b are not different signatures.

Final answer: They are not valid together in the same class. This causes a compile-time syntax error.

Worked example 2: Array boundary check

Question: If int marks[] = new int[20];, is marks[20] valid?

Step 1: The array length is 20.

Step 2: Java indexing starts from 0.

Step 3: Highest valid index = 20 - 1 = 19.

Final answer: marks[20] is invalid. It compiles when written with an integer expression, but it gives a run time array index error when executed.

Worked example 3: Choosing the correct String method call

Question: Which call changes "Java" to uppercase: toUpperCase("Java") or "Java".toUpperCase()?

Step 1: "Java" is a String object.

Step 2: A String method is called using the dot operator on the String object.

Step 3: The method name is case-sensitive: toUpperCase().

Final answer: "Java".toUpperCase().

Examiner’s mindset for Computer Applications MCQs

In an ICSE Computer Applications answer, the option alone may be enough for a pure MCQ, but your revision should include the reason. The same concept can later appear as a short-answer or output-based question. Marks are commonly lost when students know the term but do not apply the Java rule: for example, saying that x[x.length] is a syntax error instead of a run time error.

For competency questions, expect the test to check application rather than definition alone. If the question gives code, first check syntax, then data type compatibility, and finally run time behaviour.

Common mistakes students make

  • Calling every error a syntax error: A statement can be syntactically correct and still fail at run time, as in array index out of bounds errors.
  • Forgetting that Java is case-sensitive: toLowerCase() is correct, but tolowercase() is not the same method name.
  • Confusing actual and formal parameters: Formal parameters are in the method definition; actual parameters are supplied in the method call.
  • Using array length as the last index: For length n, the last index is n - 1, not n.
  • Thinking wrapper and primitive names are the same: boolean is primitive, while Boolean is the wrapper class.

Quick answer index

QuestionCorrect answerKey reason
1Syntax errorDuplicate method signature in the same class is invalid.
2(i) and (iii)User-defined methods support reusability and modularity.
3Formal parametersThey receive values during method invocation.
4public int perform(int a, int b)Correct order and comma-separated parameters.
5int m = display(45, 'A');Arguments match int, then char.
6"RESPECT".toLowerCase();Correct String method name and dot operator syntax.
7Boolean and CharacterWrapper class names begin with uppercase letters.
8UnboxingWrapper object converts to primitive value.
9length()It returns character count; other listed methods can return negative values.
10Double.parseDouble(String)Converts numeric String to primitive double.
11Run time errorx[x.length] accesses one position beyond the array.
12char gender[] = new char[80];Correct character array declaration and creation.
13(ii), (iii), (iv), (i)Create array, create Scanner, loop, then store input.
14Compared and swappedBubble sort works on adjacent elements.
1599Highest index is length minus one.
16ModularityLarge task is divided into smaller methods.

What to practise next

After finishing these ICSE Computer Applications solved competency questions, practise one example from each topic: a method call, a String method output, an array index question, and a sorting trace. Then solve full papers from the ICSE Class 10 question papers section to connect MCQs with program-writing questions.

  1. Revise Java syntax rules for methods and parameters.
  2. Practise array index and loop boundary questions.
  3. Write small String programs using length(), indexOf() and compareTo().
  4. Trace two passes of bubble sort by hand.

Frequently Asked Questions

Are these ICSE Class 10 Computer MCQs enough for Section A revision?

These ICSE Class 10 Computer MCQs help with Section A style concept revision, but students should also practise output questions, short definitions and full Java programs from the CISCE syllabus.

Why is x[x.length] a run time error in Java arrays?

In Java arrays, valid index positions run from 0 to length – 1. The expression x[x.length] tries to access one position after the last element, so the program compiles but fails at run time.

What is the difference between actual and formal parameters in ICSE Computer Applications?

Formal parameters are variables written in the method definition. Actual parameters are the values or variables passed during the method call.

Which Java String methods should Class 10 students revise for MCQs?

Class 10 students should revise length(), charAt(), substring(), indexOf(), lastIndexOf(), compareTo(), equals(), toUpperCase() and toLowerCase(), because MCQs often test return values and syntax.

How should I check an ICSE Computer Applications MCQ before choosing the option?

Read the code or definition, identify the tested concept, reject options that break Java syntax, and then check special cases such as zero-based indexing or case-sensitive method names.





Related

More from this section