0% found this document useful (0 votes)
2 views

OOPs with Java module2&3 Question Bank

The document is a question bank for the Object Oriented Programming with JAVA course at the Bangalore Institute of Technology. It includes questions on various topics such as classes, constructors, method overloading, inheritance, and interfaces, covering practical programming tasks and theoretical concepts. The questions are organized into modules, with each module focusing on different aspects of Java programming.

Uploaded by

rv8095713981
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

OOPs with Java module2&3 Question Bank

The document is a question bank for the Object Oriented Programming with JAVA course at the Bangalore Institute of Technology. It includes questions on various topics such as classes, constructors, method overloading, inheritance, and interfaces, covering practical programming tasks and theoretical concepts. The questions are organized into modules, with each module focusing on different aspects of Java programming.

Uploaded by

rv8095713981
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

BANGALORE INSTITUTE OF TECHNOLOGY

K R ROAD, V V PURA, BENGALURU-04


DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
MODULE WISE QUESTION BANK

COURSE (CODE): Object Oriented Programming with JAVA (BCS306A)

Module-2:

1) Create a simple class called Box with the data members as height width and depth and a method to
find the volume of the Box. Create Boxes with the dimensions as 10,10,10 and 5,5,5 and display the
volume of both the boxes.
2) Explain the need of “this” keyword with suitable example for its usage
3) What are constructors in Java, with respect to question 15 , write a non parameterized constructor to
initialize Box with all the values with 10 and a parameterized constructor to initialize the data
members with 5,10,15 as its values and find the volume
4) With suitable example show how objects can be passed as parameters to the functions.
5) Can objects be returned from functions, demonstrate how it can be done.
6) Does java support Method Overloading , demonstrate it with suitable example.
7) Explain Garbage collection in java
8) create a super class called Figure with two instance variables and a method called area( ). Create
subclasses called Square and Rectangle by inheriting Figure class. Override area( ) method to
compute the area of Square and Rectangle respectively.
9) Illustrate how arrays are declared and initialized in java [Write for both one-dimensional and two-
dimensional arrays].
10) Explain the purpose of each access specifies in Java and how they differ from each other.
11) Write a Java program where an outer class contains a display method and an inner class with its own
display method. Demonstrate how to call each display method from a main class.
12)Explain the use of this keyword in JAVA with an example
11) Describes the purpose of the static keyword in Java with a program example.

Module 3:

1) Define inheritance. List the different types of inheritance. Explain with suitable example.
2) Discuss the importance of the super keyword in inheritance? Illustrate with a suitable example
3) Distinguish between method overloading and method overriding in java with suitable
example/program for each.
4) Consider the following multilevel inheritance and design appropriate classes with constructors.
5) C inherits B and B inherits A. (C 🡪 B A). Create an object for class C and illustrate the order of
execution of the constructor.
6) Explain what you mean by an Abstract class and illustrate how you can make use of abstract and
concrete methods written in an Abstract class.
7) Design an interface called Polygon with a method called area. Implement this interface to create
different classes like Square, Rectangle and print the area of Square and Rectangle.
8) Can we extend Interfaces, if yes; explain with an example how it can be done.
9) Discuss how an interface is used to achieve multiple Inheritances in Java.
10) What is a constructor? List the different type of constructor and explain default constructor with
example.
11) Explain the significance of final keyword with respect to data members, methods and classes.

You might also like