You are on page 1of 6

OBJECT ORIENTED PROGRAMMING METHODOLOGY - QUESTION BANK

(FY BSC CS/IT Sem 2 – 2023-24)

NOTE:
This Question Bank is only for reference. It contains general types of questions which can be asked in exams.
Students are advised to refer other resources like reference books for preparation.

Questions marked with () are PYQs (previous year questions).

UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING IN JAVA


1.1 Object oriented programming
1.2 Structured vs object-oriented programming
1.3 Object oriented programming languages
1.4 Overview of object-oriented programming features – data hiding, abstraction, encapsulation,
inheritance, polymorphism
1.5 Classes and objects
1.6 Class attributes/variables
1.7 Class methods
1.8 Calling class methods
• Calling user defined class methods without parameters
• Calling user defined class methods with primitive datatype parameters
• Calling user defined class methods with object as parameters
1.9 Access modifiers and its usage for data hiding

SHORT QUESTIONS
1. Briefly explain the key features of object-oriented programming.
2. How does Object-Oriented Programming address the challenges faced by Structured
Programming?
3. Name three popular object-oriented programming languages and briefly mention their
applications.
4. Differentiate between Classes and Objects in Object-Oriented Programming.
5. Explain the relationship between a Class and its Object(s).
6. What are class attributes/variables and how are they accessed outside the class?
7. Explain the difference between public and private attributes in terms of data access.
8. What are the advantages of implementing data hiding in object-oriented programming?
9. What are access modifiers?
10. Why is Java considered a fully object-oriented language but not a pure object-oriented
language?

LONG QUESTIONS
1. What are some major features of OOP? Discuss them in brief.
2. Compare and contrast structured and object-oriented programming paradigms. Discuss when
you would choose one over the other for a specific project, providing justification for your
decision.
3. What is OOP? How is it difference than procedure-oriented programming? Explain
encapsulation and abstraction concept with example. ()
4. Explain OOP features with concrete examples from real-world scenarios, demonstrating how
they contribute to building robust and flexible object-oriented programs.
5. How can you pass an object as a parameter in a class method?
6. Explain access modifiers in Java with examples demonstrating their scope.

1 Prepared by: Prof. Lavleena Stephens


OBJECT ORIENTED PROGRAMMING METHODOLOGY - QUESTION BANK
(FY BSC CS/IT Sem 2 – 2023-24)

UNIT 2 - OBJECT - CONSTRUCTION, ACCESSIBILITY AND CLEAN-UP


2.1 Constructor and its types
2.1.1 Default constructor
2.1.2 Parameterized constructor
2.1.3 Copy constructor
2.2 Garbage collection in java
2.3 new() and finalize() methods
2.4 static keyword – static variables and methods
2.5 this keyword
2.6 Array of objects

SHORT QUESTIONS
1. Differentiate between a constructor and a method in terms of syntax and behaviour.
2. Briefly explain the concept of a constructor in object-oriented programming.
3. What is default constructor? ()
4. Under what circumstances does Java automatically create a default constructor for a class?
5. What is the purpose of a copy constructor in Java?
6. Explain the purpose of the new keyword.
7. Describe the finalize() method and its role in object cleanup before garbage collection.
8. Is it required to destruct the object compulsory? ()
9. What is the use of finalize() method? ()
10. How Garbage collection works in Java? ()
11. Describe the various uses of the this keyword within a Java class.

LONG QUESTIONS
1. Discuss different types of constructors in Java with examples.
2. Explain this, final, super and static keyword with example. ()
3. What is constructor? Write a program to initialize class variables with a constructor. ()
4. Write a short note on Garbage Collection in Java.
5. Explain static member variable and static member function with proper example. ()
6. Explain how to create an array of objects in Java and provide a code example.
7. Describe how to access and manipulate individual objects within an array of objects.

UNIT 3 - EXCEPTION HANDLING IN JAVA


3.1 Need of exception handling
3.2 Types of exceptions
3.3 Try… catch block
3.4 Finally clause
3.5 Throw clause
3.6 Throws clause

SHORT QUESTIONS
1. Explain why exception handling is crucial in Java programming.
2. List out types of exceptions and briefly explain each.
3. Describe the potential consequences of not handling exceptions properly.

2 Prepared by: Prof. Lavleena Stephens


OBJECT ORIENTED PROGRAMMING METHODOLOGY - QUESTION BANK
(FY BSC CS/IT Sem 2 – 2023-24)

4. What is the purpose of finally clause?


5. What is the purpose of throw clause?
6. What is the purpose of throws clause?
7. What is the difference between error and exception?

LONG QUESTIONS
1. Explain exception handling concept with example. ()
2. Differentiate between checked and unchecked exceptions, providing examples of each.
3. Explain the concept of custom exceptions and how they can be created in Java.
4. Describe the Java Exception hierarchy and its significance in exception handling.
5. Explain the syntax and purpose of a try...catch block in Java exception handling.
6. Explain difference between checked and unchecked exceptions in terms of the throws clause.
7. Differentiate between throw and throws with examples.

UNIT 4 - INHERITANCE
4.1 Importance of inheritance in object-oriented programming
4.2 Types of inheritance
4.2.1 Single
4.2.2 Multilevel
4.2.3 Hierarchical
4.2.4 Multiple (using interface)
4.2.5 Hybrid
4.3 Use of super keyword
4.4 Order of calling constructors

SHORT QUESTIONS
1. What is inheritance in terms of Object-Oriented Programming?
2. What are the advantages of using inheritance to create new classes based on existing ones?
3. What relationship does inheritance generate?
4. Differentiate between multilevel and hierarchical inheritance.
5. Differentiate between multilevel and multiple inheritance in Java.
6. How can you achieve multiple inheritance in Java?
7. What is the use of super keyword in Java?

LONG QUESTIONS
1. What is inheritance? How is this concept beneficial in software development?
2. Discuss different types of inheritance supported in Java.
3. How multiple inheritance is implemented in Java. Explain by giving suitable example. ()
4. What is hierarchical inheritance? Write a program to illustrate this inheritance with base class
exam and two derived classes internal exam and external exam. ()
5. What is an interface? How can you achieve multiple inheritance through interface?
6. What is diamond problem? How can you solve it?
7. What is hybrid inheritance? Explain with example.
8. Explain the use of super keyword with suitable example.
9. What is the general order of calling constructors? Explain with a suitable example.

3 Prepared by: Prof. Lavleena Stephens


OBJECT ORIENTED PROGRAMMING METHODOLOGY - QUESTION BANK
(FY BSC CS/IT Sem 2 – 2023-24)

UNIT 5 - POLYMORPHISM
5.1 Method overloading
5.2 Method overriding and dynamic binding
5.3 Using Final keyword to prevent overriding and inheritance

SHORT QUESTIONS
1. Define polymorphism. What are different types of polymorphism supported in Java.
2. List out rules for overloading methods in Java.
3. What is binding?
4. Differentiate between early binding and late binding.
5. Under what circumstances is method overloading not possible?
6. How does the super keyword relate to method overriding?
7. What is use of the final keyword?
8. When can you make a class or a method final?

LONG QUESTIONS
1. Discuss method overloading with example.
2. Discuss method overriding with example.
3. What is the difference between method overloading and method overriding? ()
4. Explain the use of the final keyword in Java to prevent method overriding and inheritance using
appropriate example.

UNIT 6 - ABSTRACTION
6.1 Need of abstraction
6.2 Abstract class
6.3 Abstract class vs interface

SHORT QUESTIONS
1. What is the need of abstraction in object-oriented programming?
2. What is an abstract class? Provide its general syntax.
3. Define interface in a Java program.
4. How can you achieve complete (100%) abstraction in Java?
5. Can an abstract class contain non-abstract method? Justify your answer.
6. Differentiate between a class and an interface.
7. Differentiate between abstract class and interface.

LONG QUESTIONS
1. What is an abstract class? Explain its key features with example.
2. Explain abstract class concept. ()
3. Differentiate between abstract class and interface with suitable examples.
4. How can you achieve polymorphism using abstract class and interface? Give example.

4 Prepared by: Prof. Lavleena Stephens


OBJECT ORIENTED PROGRAMMING METHODOLOGY - QUESTION BANK
(FY BSC CS/IT Sem 2 – 2023-24)

UNIT 7 - ENCAPSULATION AND PACKAGES IN JAVA


7.1 Significance of Encapsulation
7.2 What is a package?
7.3 Importance of package
7.4 Creating and accessing package in java
7.5 Adding classes to package
7.6 Inbuilt packages – Java.util, Java.lang, Java.io

SHORT QUESTIONS
1. What are some key benefits of using encapsulation.
2. List out techniques used to perform encapsulation in Java.
3. What is Package? () Give the general syntax of declaring a package in Java.
4. What are the steps of creating a package in Java?
5. How can you add class in a package?
6. What is a fully encapsulated class in Java?
7. Differentiate between abstraction and encapsulation.
8. Differentiate between encapsulation and data hiding.

LONG QUESTIONS
1. How can you implement encapsulation in Java? Explain with the help of an example.
2. Define package and how can you organize your code using a package?
3. Which is the package that is imported by default? Write a note on packages with example. ()
4. List some common inbuilt packages. Provide examples how these packages are used in Java
applications.

UNIT 8 - INNER CLASS IN JAVA


8.1 Inner classes – need and advantages
8.2 Accessing members of outer class within inner class
8.3 Difference between nested class and inner class
8.4 Types of nested classes

SHORT QUESTIONS
1. Define nested classes.
2. What are some advantages of using an inner class?
3. List out different types of nested classes.
4. How can you access the class attributes in another class?
5. What is the difference between a nested class and an inner class?

LONG QUESTIONS
1. Explain the concept of inner class with examples.
2. What are nested class? Discuss types of nested classes with their unique characteristics and
limitations of each type of nested class.
3. Explain how nested classes can be used to implement nested interfaces in Java.
4. Differentiate between inner classes and nested classes based on their location and
lifecycle(scope).
5 Prepared by: Prof. Lavleena Stephens
OBJECT ORIENTED PROGRAMMING METHODOLOGY - QUESTION BANK
(FY BSC CS/IT Sem 2 – 2023-24)

INSTRUCTIONS FOR EXAMS:


• Before attempting, read the entire question paper carefully.
• Always try to write precise content, i.e., important points with brief description.
• Include diagrams, examples, code snippets wherever you feel necessary.
• The answer’s content should match the total weightage of the question.
• Always keep the track of time, do not spend too much time on one question.

6 Prepared by: Prof. Lavleena Stephens

You might also like