Skip to content

Question bank

Every question, by chapter, year, marks and type.

64 questions

  • Practice question

    3 marks

    State three differences between a constructor and a method.

    Class 11 Computer ScienceConstructorsMediumShort answer

  • Practice question

    3 marks

    Evaluate the expression 10 + 5 * 2 - 8 / 4 in Java and explain the order of evaluation.

    Class 11 Computer ScienceOperators and Expressions in JavaMediumNumerical

  • Practice question

    3 marks

    What is method overloading? State the conditions under which two methods are said to be overloaded.

    Class 11 Computer ScienceUser-Defined MethodsMediumShort answer

  • Practice question

    3 marks

    Write a Java program segment to print an inverted right-angled triangle of stars with n rows, the first row having n stars.

    Class 11 Computer ScienceNested LoopsMediumApplication based

  • Practice question

    3 marks

    State three differences between the if-else construct and the switch-case construct.

    Class 11 Computer ScienceConditional ConstructsMediumShort answer

  • Practice question

    3 marks

    What is the this keyword and when is it needed?

    Class 11 Computer ScienceEncapsulation and Class as a User-Defined TypeMediumShort answer

  • Practice question

    3 marks

    What is constructor overloading? Give one situation in which it is useful.

    Class 11 Computer ScienceConstructorsMediumShort answer

  • Practice question

    3 marks

    What is the output of: System.out.println(10 / 3); System.out.println(10 % 3); System.out.println(10.0 / 3);

    Class 11 Computer ScienceValues and Data TypesMediumNumerical

  • Practice question

    3 marks

    Reduce the Boolean expression X·Y + X·Y′ using the laws of Boolean algebra.

    Class 11 Computer ScienceBoolean AlgebraMediumNumerical

  • Practice question

    3 marks

    What is the output of: int a = 10, b = 3; System.out.println(a > b && a % b == 1);

    Class 11 Computer ScienceOperators and Expressions in JavaMediumNumerical

  • Practice question

    3 marks

    State three differences between procedural and object-oriented programming.

    Class 11 Computer ScienceIntroduction to Object-Oriented ProgrammingMediumShort answer

  • Practice question

    3 marks

    What is short-circuit evaluation, and give one practical use of it.

    Class 11 Computer ScienceOperators and Expressions in JavaMediumShort answer

  • Practice question

    3 marks

    Name the access specifiers of Java and state the visibility each gives.

    Class 11 Computer ScienceEncapsulation and Class as a User-Defined TypeMediumShort answer

  • Practice question

    3 marks

    State the converse, inverse and contrapositive of "If it rains, the match is cancelled", and say which is logically equivalent to the original.

    Class 11 Computer SciencePropositional LogicMediumShort answer

  • Practice question

    3 marks

    What is the output of: String s = "Computer"; System.out.println(s.substring(2, 5) + s.length() + s.charAt(0));

    Class 11 Computer ScienceString HandlingMediumNumerical

  • Practice question

    2 marks

    What is a constructor? State three of its characteristics.

    Class 11 Computer ScienceConstructorsEasyShort answer

  • Practice question

    3 marks

    What is the output of: String s = "Examination"; System.out.println(s.length() + " " + s.substring(0, 4) + " " + s.toUpperCase().charAt(2));

    Class 11 Computer ScienceString HandlingMediumNumerical

  • Practice question

    3 marks

    Write a Java program segment to find the average of the elements of an integer array a of size n.

    Class 11 Computer ScienceArraysMediumApplication based

  • Practice question

    3 marks

    Distinguish between a primitive type and a reference type in Java, with two examples of each.

    Class 11 Computer ScienceValues and Data TypesMediumShort answer

  • Practice question

    3 marks

    Simplify the Boolean expression (X + Y)(X + Y′).

    Class 11 Computer ScienceBoolean AlgebraMediumNumerical