AD-305 · Object Oriented Programming & Methodology/Unsolved PYQ Paper
AD-305 Object Oriented Programming and Methodology - Dec 2023 Question Paper
Under each question, How to answer lists the points an answer should cover, outlined by CampusPrep from the syllabus. Check the details against your textbook.
-
7 MarksaWhat do you understand by object-oriented programming? What are the advantages of programming using object oriented? Explain and define various OOP concepts in brief.
How to answer
- Definition of Object-Oriented Programming (OOP) paradigm.
- Key advantages: modularity, reusability, maintainability, data security.
- Brief definitions and explanations of core concepts: Class, Object, Encapsulation, Data Abstraction, Inheritance, Polymorphism, Dynamic Binding, Message Passing.
-
7 MarksbBriefly describe merits and demerits of object-oriented methodology.
How to answer
- Merits: Code reusability (inheritance), ease of maintenance, data hiding/security, better mapping to real-world problems.
- Demerits: Steeper learning curve, larger program size, potentially slower execution due to overhead, not suitable for all problem domains.
-
7 MarksaWhat are the properties of encapsulation and data abstraction?
How to answer
- Definition and key properties of Encapsulation (bundling data and methods, data hiding, access specifiers: private/protected/public).
- Definition and key properties of Data Abstraction (showing only essential details, hiding implementation, abstract classes/interfaces).
- Distinction/relationship between abstraction (design level) and encapsulation (implementation level).
-
7 MarksbWhat is construction and destruction? Explain with suitable example.
How to answer
- Definition and purpose of Constructors (automatic initialization on object creation).
- Definition and purpose of Destructors (cleaning up resources when object goes out of scope).
- Code example in C++/Java illustrating constructor and destructor (or finalize/cleaner).
- Characteristics: same name as class, no return type, tilde prefix (C++).
-
7 MarksaExplain the parameter passing models briefly.
How to answer
- Explanation of Pass by Value (copy of actual parameter is passed; modifications do not affect original).
- Explanation of Pass by Reference (alias/reference to original variable passed; modifications affect original).
- Explanation of Pass by Address/Pointer (memory address passed).
- Brief code snippet or diagram illustrating memory behavior.
-
7 MarksbDescribe the role of multiple inheritance in object-oriented programming.
How to answer
- Definition of multiple inheritance (a class deriving from more than one base class).
- Role/advantages: combining features from different hierarchies, modeling complex real-world relationships.
- Issues associated: Diamond problem / ambiguity.
- How it is handled in C++ (virtual inheritance) vs Java (interfaces).
-
7 MarksaExplain the meaning of polymorphism. How polymorphism is achieved at run time? Explain with an example.
How to answer
- Definition of polymorphism ('many forms').
- Distinction between compile-time and run-time polymorphism.
- Mechanism of runtime polymorphism: method overriding, virtual functions (C++) / dynamic method dispatch (Java), vptr and vtable.
- Complete code example demonstrating base pointer pointing to derived class object.
-
7 MarksbDifferentiate between Overriding and Overloading methods.
How to answer
- Tabular comparison based on: scope/context, parameter list/signature, return type rules, binding mechanism (early vs late binding), and inheritance requirement.
- Short code snippets showing overloading vs overriding.
-
7 MarksaExplain the concept of exception handling in JAVA.
How to answer
- Definition of an exception and purpose of handling exceptions.
- Exception hierarchy in Java (Throwable -> Exception, Error; Checked vs Unchecked).
- Key keywords: try, catch, finally, throw, throws.
- Code example showing try-catch-finally block.
-
7 MarksbWhat is meant by file stream objects? Give example.
How to answer
- Definition of a stream as a sequence of bytes.
- Concept of file stream objects (bridges connecting program to physical files for I/O operations).
- Types: Input stream objects (reading) and Output stream objects (writing).
- Example in C++ (ifstream, ofstream, fstream) or Java (FileInputStream, FileOutputStream, FileReader, FileWriter) with code.
-
7 MarksaWrite a C++/JAVA program to calculate the area of rectangle, square and circle using constructor overloading.
How to answer
- Declare a class (e.g., `Shape` or `Area`).
- Provide overloaded constructors: one parameter (float/double for circle, or int for square), two parameters (for rectangle).
- Store or compute the area in each constructor or a display method.
- Provide `main()` function instantiating objects for rectangle, square, and circle, displaying each computed area.
-
7 MarksbWhat is interface? Discuss its concept interfaces.
How to answer
- Definition of interface in Java/OOP (a blueprint of a class containing abstract methods and constants).
- Key characteristics: 100% abstraction (prior to Java 8), multiple inheritance support, loose coupling.
- Syntax of defining and implementing an interface (`interface` and `implements` keywords).
- Brief code snippet showing interface declaration and implementation.
-
7 MarksaExplain the concept of multithreading in object-oriented programming approach. Writes its benefits.
How to answer
- Definition of thread (lightweight subprocess) and multithreading (concurrent execution of two or more threads).
- Multithreading in OOP context (e.g., in Java using `Thread` class or `Runnable` interface).
- Benefits: maximum CPU utilization, responsive UI, parallel execution, reduced idle time, independent execution.
- Brief description of thread states (New, Runnable, Running, Blocked/Waiting, Terminated).
-
7 MarksbExplain library management system using object-oriented diagram.
How to answer
- Identify core classes/entities: `Book`, `Member`/`User`, `Librarian`, `Account`, `Transaction`/`Loan`.
- Draw UML Class Diagram showing classes with attributes, methods, and relationships (association, inheritance, aggregation).
- Explain functionality: issue book, return book, calculate fine, search book.
- Briefly explain the role of OOP concepts applied in the design.
-
14 MarksWrite short notes on (any two):
- a)Data Collection
- b)Message Passing
- c)Static polymorphism
How to answer
- Data Collection: Concept of gathering and storing objects/data structures (e.g., collections framework in Java: List, Set, Map).
- Message Passing: Process of communication between objects by invoking methods/passing arguments; components (receiving object, method name, arguments).
- Static polymorphism: Compile-time polymorphism achieved via method/function overloading and operator overloading; binding resolved at compile time.
Go to where you left off?
Quick Add to Notes
Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.
Create free accountHave an account? Log in
Notes Panel