LIWA

Introduction to Object Oriented Programming Concepts

ICSE Class 9 · Computer Applications · Chapter 1

What this chapter covers

Key points

Questions answered

Define object oriented programming.
Object oriented programming is an approach in which a program is built from objects, each combining data and the functions that work on that data into a single unit, with objects working together by sending messages to one another.
State two differences between procedure oriented programming and object oriented programming.
In procedure oriented programming the basic unit is a procedure and data is mostly shared by all functions; in object oriented programming the basic unit is an object and data is kept protected inside objects. Procedure oriented programming follows a top-down design, while object oriented programming follows a bottom-up design.
Define data abstraction and give one real-life example.
Data abstraction is the act of representing the essential features of an object while hiding the background details. A person drives a car using the steering wheel, accelerator and brakes without knowing how the engine works inside.
What is encapsulation? How does it help to protect data?
Encapsulation is the wrapping up of data and the functions that operate on it into a single unit. Since the data can be reached only through the unit's own functions, no other part of the program can change it directly, which protects it from careless change (data hiding).
Name the principle of OOP that allows code to be reused, and explain it with an example.
Inheritance. A class `Student` can inherit a name and address from a class `Person` and add a roll number of its own, so the common features are written once and reused.
What is polymorphism? Give a real-life example.
Polymorphism is the ability of a single message or method name to take more than one form, behaving differently depending on the object it acts on. The message "make a sound" makes a dog bark and a cat mew.
Why do schools often prefer open source software? Name the open source Java development kit suggested by the syllabus.
Open source software is free to install on every computer, its code can be studied and improved, and errors are fixed quickly by a large community. The suggested kit is OpenJDK (Open Java Development Kit).
What is an IDE? Name any two IDEs used for Java.
An IDE (Integrated Development Environment) is a software application that brings together an editor, compiler, runner and debugger in one window. BlueJ and NetBeans are two IDEs for Java.

Past board exam questions

ICSE 2027 sample paper · 1 mark

Megha knows how to bake cookies in the microwave oven, but she does not know about the internal, unseen components of the microwave oven. Identify the OOPs feature depicted in this scenario.

  1. Abstraction
  2. Polymorphism
  3. Inheritance
  4. Modularity
Show answer
Abstraction

ICSE 2027 sample paper · 5 marks

Answer the following questions: (a) Name the type of error which occurs while compiling a program. (b) Which Java package is imported by default? (c) Define an object in Java. (d) What is the full form of JDK? (e) What is the Math method to convert – 4 to 4?

Show answer
(a) Syntax error (compile-time error). (b) java.lang (c) An object is an instance of a class; it has its own state (data members) and behaviour (methods). (d) Java Development Kit (e) Math.abs( ) — Math.abs(-4) returns 4.

ICSE 2027 sample paper · 2 marks

(a) Raj climbs 5 floors by climbing 14 steps to reach each floor. Name the programming concept that can be used to depict the same. (b) Identify the Object-Oriented Programming concept implemented in the scene below: A mother says “Son, I am base class” and her son replies “Mom, I am derived class”.

Show answer
(a) Nested loop (an outer loop for the 5 floors and an inner loop for the 14 steps of each floor). (b) Inheritance (the derived class inherits from the base class).