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

Model Question Paper 1

Uploaded by

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

Model Question Paper 1

Uploaded by

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

Model Question Paper-I

Object Oriented Programming with Java (BCS306A)

Time: 3 Hours Max. Marks: 100

Note: Answer any FIVE full questions, choosing one full question from each module.

Module-1

1. a. Explain the following concepts of object oriented program:


i. Encapsulation
ii. Polymorphism
iii. Inheritance
iv. Data Abstraction (8 Marks)

b. Explain the various primitive data types used in Java. Give suitable examples.
(8 Marks)

c. What is type casting? Illustrate with an example, what is meant by automatic type
casting? (4 Marks)

OR

2. a. Define an array. Write the array declaration syntax for one dimensional and
multidimensional array with example. (8 Marks)

b. List out and explain the different looping statements used in Java with syntax and
examples. (8 Marks)

c. Write a Java program to sum only first five elements of the array using for each loop.
(4 Marks)

Module-2

3. a. What is class? How to define class in Java? Explain with syntax and examples. (8 Marks)

b. Write a Java program to create a class called stack and implement all the operations on
stack using different methods. (8 M Marks)

c. What is recursion? Explain with examples. (4 Marks)

OR

4. a. Explain static data and static methods with examples. (8 Marks)


b. How to define nested class in Java? Explain with suitable example. (8 Marks)

c. Explain the use of final keyword with examples. (4 Marks)

Module-3

5. a. What are super class constructors? How does super class members are used in Java.

(10 Marks)

b. What is method overriding? Explain how it allows Java to support run-time polymorphism
with an example. (10 Marks)

OR

6. a. Develop a JAVA program to create an abstract class Shape with abstract methods
calculateArea() and calculatePerimeter(). Create subclasses Circle and Triangle that extend the
Shape class and implement the respective methods to calculate the area and perimeter of each
shape. (10 Marks)

b. What is interface? How to implement interface in Java? Explain with suitable examples.

(10 Marks)

Module-4

7. a. Describe the various levels of access protections available for packages and their
implications. (8 Marks)

b. Give the basic form of an exception handling blocks. (4 Marks)

c. Develop a JAVA program to raise a custom exception (user defined exception) for
DivisionByZero using try, catch, throw and finally. (8 Marks)

OR

8. a. Define package. Explain the creation of package with suitable example program. (8 Marks)

b. Develop a simple program and explain multiple catch blocks. (8 Marks)

c. What is the importance of clause finally? (4 Marks)


Module-5

9. a. What is Thread? Explain two ways of creation threads in Java with examples. (10 Marks)

b. Define synchronization. Explain how inter-thread communication can be achieved in


multithreading using producer consumer problem. (10 Marks)

OR

10. a. With syntax and examples, explain the use of isAlive( ) and join( ) methods. (10 Marks)

b. Write a program to illustrate creation of threads using runnable class. (start method start
each of the newly created thread. Inside the run method there is sleep() for suspend the thread for
500 milliseconds). (10 Marks)

You might also like