ICSE · Class 9 · Computer Applications

Class 9 Introduction to Object Oriented Programming Concepts Mock Test (ICSE)

6 practice questions from Introduction to Object Oriented Programming Concepts, in the style of your board paper, each with a worked answer and the marks for every step. Then take a full chapter test on paper, snap the pages and get every step marked.

Topics in Introduction to Object Oriented Programming Concepts

  • Procedure-oriented and object-oriented programming
  • Principles of OOP: abstraction, encapsulation, inheritance, polymorphism
  • Java as a language
  • Java compilation process and bytecode
  • Features of Java

Introduction to Object Oriented Programming Concepts practice questions with answers

  1. Q1Multiple choice1 mark
    Who is known as the leader of the team that initiated the Java language project at Sun Microsystems?
    1. (a)Bjarne Stroustrup
    2. (b)James Gosling
    3. (c)Guido van Rossum
    4. (d)Dennis Ritchie
    Show answer and step marks
    1. Correct option: (b) James Gosling+1
    Answer: (b)
  2. Q2Multiple choice1 mark
    Which feature of Java allows a program to execute multiple tasks simultaneously by defining multiple threads of execution?
    1. (a)Dynamic
    2. (b)Portable
    3. (c)Distributed
    4. (d)Multithreaded
    Show answer and step marks
    1. Correct option: (d) Multithreaded+1
    Answer: (d)
  3. Q3Multiple choice1 mark
    A programmer declares the field balance as private in a class BankAccount and provides only the public methods deposit(int amount) and getBalance(). Code outside the class cannot change balance directly and must use deposit(). Which principle of object-oriented programming does this design illustrate?
    1. (a)Abstraction
    2. (b)Inheritance
    3. (c)Encapsulation
    4. (d)Polymorphism
    Show answer and step marks
    1. Correct option: (c) Encapsulation+1
    Answer: (c)
  4. Q4Short answer3 marks
    Differentiate between the output produced by a C compiler and the output produced by the Java compiler on the basis of the form of that output and the place where it can be run.
    Show answer and step marks
    1. A C compiler converts the source program into machine code that is specific to the processor and operating system it was compiled for+1
    2. The Java compiler converts the source program into bytecode, not into machine code+1
    3. Java bytecode is run by the Java Virtual Machine on any platform, so it is platform-independent, whereas C machine code runs only on the system it was compiled for+1
    Answer: A C compiler produces machine code that runs only on the processor and operating system it was compiled for, whereas the Java compiler produces bytecode that the Java Virtual Machine runs on any platform.
  5. Q5Long answer4 marks
    (a) Explain what is meant by the term 'Platform Independent' with reference to Java. How does Java achieve this property? (b) State and briefly explain any two other key features of Java that make it robust and secure for internet applications.
    Show answer and step marks
    1. (a) Meaning: a Java program compiled once can run on any computer and operating system without being rewritten or recompiled ('write once, run anywhere').+1
    2. (a) How: the Java compiler converts source code into bytecode, which is not tied to any machine; the Java Virtual Machine (JVM) on each platform interprets or executes this bytecode.+1
    3. (b) First feature, any one of: Robust, since strong compile-time type checking and exception handling catch errors and stop programs from crashing; automatic garbage collection, which frees unused memory and prevents memory leaks; Secure, since Java has no explicit pointers, so programs cannot access memory directly; bytecode verification, where the JVM checks bytecode before running it inside a restricted sandbox; or any other valid robustness or security feature, briefly explained.+1
    4. (b) Second feature, a different one from the same list, briefly explained.+1
    Answer: (a) Platform independence means a compiled Java program runs on any platform without change; Java achieves it by compiling source code to machine-neutral bytecode that the JVM on each platform executes. (b) Any two of: robustness through strong type checking and exception handling; automatic garbage collection preventing memory leaks; security through having no explicit pointers; bytecode verification and sandboxed execution in the JVM.
  6. Q6Long answer4 marks
    A college office uses a Java program to record student fee payments and print dues reports. Study each situation below and identify the feature of Java it illustrates. (a) The same compiled file is copied from a Windows computer to a Linux server and a macOS computer, and it runs on all three without being recompiled. [1] (b) While a long dues report is being printed in one line of execution, the clerk can still enter new receipts, because the entry screen runs in a different line of execution. [1] (c) Before the program starts running, the Java system checks the bytecode and stops any attempt by the code to access memory it is not allowed to use. [1] (d) Objects that are no longer used are removed from memory by the Java system, so the programmer never writes any code to free that memory. [1]
    Show answer and step marks
    1. (a) Platform independence (architecture neutrality), because the bytecode runs on any system that has a Java Virtual Machine.+1
    2. (b) Multithreading, because two separate lines of execution run at the same time within one program.+1
    3. (c) Security, because the bytecode is verified before it runs and illegal memory access is blocked.+1
    4. (d) Automatic garbage collection (automatic memory management), because the Java system frees unused objects without the programmer's code.+1
    Answer: (a) Platform independence; (b) Multithreading; (c) Security; (d) Automatic garbage collection (automatic memory management)

Take a full Introduction to Object Oriented Programming Concepts test

PrepitUp writes a fresh paper on this chapter at the length you pick. Write it on paper with a timer, photograph the pages, and see the marks for every step and what to practise next.

  • 15 min10 marks
  • 30 min20 marks
  • 1.5 hr40 marks
  • 3 hr80 marks
See a sample marked answer sheet

Get your Introduction to Object Oriented Programming Concepts answers marked

Sign in, pick this chapter and a length, write the test on paper and get every step marked.

Sign in to take this test

More Class 9 Computer Applications mock tests