0% found this document useful (0 votes)
2 views3 pages

j18 - Cs504a - Object Oriented Programming Using Java

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

j18 - Cs504a - Object Oriented Programming Using Java

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JISCE / UG / CSE / R18 / ODD / SEM-5 / CS504A / 2024-25 / 1

Roll Number

CS504A - OBJECT ORIENTED PROGRAMMING USING JAVA


TIME ALLOTTED: 3Hours FULL MARKS: 70

Instructions to the candidate:


Figures to the right indicate full marks.
Draw neat sketches and diagram wherever is necessary.
Candidates are required to give their answers in their own words as far as practicable

Group A
(Multiple Choice Type Questions)
Answer any ten from the following, choosing the correct alternative of each question: 10×1=10
1.i) When final keyword has been used before method name – (1) CO3 BL1
a) method becomes abstract
b) method can’t be overloaded
c) method can’t be overrided
d) None of these.

[Link]) Identify the correct definition of a package. (1) CO6 BL1


a) A package is a collection of editing tools
b) A package is a collection of classes
c) A package is a collection of classes and interfaces
d) A package is a collection of interfaces

[Link]) Identify the keyword among the following that makes a variable (1) CO1 BL1
belong to a class rather than being defined for each instance of
the class.
a) Final
b) Static
c) Volatile
d) Abstract

[Link]) What is the output of this code fragment? (1) CO2 BL2
int a=4; int b=10;

a) 2
b) 0
c) 1
d) 3

1.v) Which of the following exception is thrown when divided by (1) CO4 BL1
zero statement is executed?
a) NullPointerException
b) NumberFormatException
c) ArithmeticException
d) None of these

[Link]) JVM is (1) CO1 BL1


a) Platform dependent
b) Platform independent

1/14/2025 8:43:11 AM
1 of 3
JISCE / UG / CSE / R18 / ODD / SEM-5 / CS504A / 2024-25 / 1

c) Depends on operating system only


d) Depends on machine architecture only

[Link]) What restriction is there on using the super reference in a (1) CO3 BL4
constructor?
a) It can only be used in the parent's constructor.
b) Only one child class can use it.
c) It must be used in the last statement of the constructor
d) It must be used in the first statement of the constructor

[Link]) What is the correct ordering for the import, class and package (1) CO4 BL2
declarations when found in a single file?
a) package, import, class
b) import, package, class
c) class, import, package
d) package, class, import

[Link]) When is the object created with new keyword? (1) CO1 BL1
a) Depends on the code
b) At run time
c) At compile time
d) None

1.x) Out of the following which one is not correctly matched? (1) CO2 BL2
a) int- 24 bits
b) double - 64 bits
c) short -16 bits
d) byte - 8 bits

[Link]) Which one of the following is wrong? (1) CO5 BL1


a) Runnable is a predefined interface
b) The sleep() method instructs a thread to terminate its execution
c) The isAlive() method tells whether a thread has not yet died
d) MAX_PRIORITY represents the level 10

[Link]) When an array is passed to a method, what does the method (1) CO2 BL2
receive?
a) The reference of the array
b) A copy of the array
c) Length of the array
d) Copy of first element

Group B
(Short Answer Type Questions)
(Answer any three of the following) 3x5=15
2. What is the significance of using “this” keyword? Explain with (5) CO5 BL2
example programs. What is the difference between final and finally
keyword in java?
3. Write a comparative study among final, finally and finalize. Write the (5) CO5 BL3
functionalities of Synchronized.

1/14/2025 8:43:11 AM
2 of 3
JISCE / UG / CSE / R18 / ODD / SEM-5 / CS504A / 2024-25 / 1

4. Discuss the Applet life-cycle indicating the functions. (5) CO4 BL2
5. Explain the terms “class” and “object” w.r.t. Object Oriented (5) CO1 BL4
Programming using suitable example. Explain the terms: (i)
Association and (ii) Aggregation in object oriented programming.
6. What are the two methods to create threads? Compare them and (5) CO5 BL5
explain them with an example Java program.
Group C
(Long Answer Type Questions)
(Answer any three of the following) 3x15=45
7a. What is Polymorphism? Explain with a suitable example. (5) CO2 BL3
7b. Explain the term “Inheritance” with the help of a simple code (5) CO3 BL3
snippet. Describe different types of Inheritance in java with the help
of their own diagram?
7c. What is Inner class? Explain with a small program. (5) CO3 BL4
8a. What is multithreading? How can you create a thread by (5) CO4 BL2
implementing Runnable interface in java?
8b. Explain the term “object” and “class” in Object oriented (5) CO4 BL3
programming? What the different features are of Object Oriented
Programming?
8c. What is thread synchronization? Explain the importance of (5) CO5 BL2
synchronized keyword with code.
9a. Describe Dynamic polymorphism or Method Overriding technique (5) CO3 BL1
with the help of a simple Java program.
9b. How can you create your own package and add classes inside that (5) CO2 BL3
package? Explain with the help of an example.
9c. Describe the differences between an Applet and an Application. (5) CO5 BL2
Explain Thread Lifecycle with suitable diagram.
10a. What is the difference between “String class” and “String buffer (5) CO5 BL3
class” in java string?
10b. Describe a comparative analysis of class, abstract class and (5) CO3 BL2
interface.
10c. Explain the term “Copy constructor” using a small Java program. (5) CO4 BL3
11a. State the significance of “new” operator in Java? What is (5) CO4 BL2
ArrayIndexOutOfBound exception?
11b. Write a simple program of using multiple catch blocks (including (5) CO5 BL2
base & subclass exception).
11c. Implement multilevel inheritance and Hierarchical Inheritance both (5) CO5 BL4
within a single Java program.
1/14/2025 8:43:11 AM

3 of 3

You might also like