GOVERNMENT POLYTECHNIC BHOJPUR
Roll No:
[Time: 1 Hour] [Full Marks: 20]
Subject: Java Programming Semester : 4 th
Group (A)
Q.1 Answer all questions as directed. (1×6 = 6)
a) A constructor is used to ______.
(initialize object / delete object / print output / none)
b) Which keyword refers to current object?
(this / super / self / obj)
c) Which access modifier allows access within same package only?
(public / private / protected / default)
d) Which keyword is used to handle exceptions?
(catch / try / throw / all)
e) Which concept allows one class to acquire properties of another?
(polymorphism / inheritance / abstraction / encapsulation)
f) Java supports multithreading.
(True / False)
Group (B)
Attempt any TWO questions. (2×4 = 8)
Q.2 Explain constructors in Java (default and parameterized) with examples.
Q.3 Explain types of inheritance with suitable examples.
Q.4 Explain exception handling in Java using try-catch with example.
Group (C)
Attempt any ONE question. (1×6 = 6)
Q.5 Write a Java program to:
Create a class
Use constructor to initialize values
Display output
OR
Q.6 Write a Java program to:
Read a file
Handle exception using try-catch
GOVERNMENT POLYTECHNIC BHOJPUR
Roll No:
[Time: 1 Hour] [Full Marks: 20]
Subject: Java Programming Semester : 4 th
Group (A)
Q.1 Answer all questions as directed. (1×6 = 6)
a) A constructor is used to ______.
(initialize object / delete object / print output / none)
b) Which keyword refers to current object?
(this / super / self / obj)
c) Which access modifier allows access within same package only?
(public / private / protected / default)
d) Which keyword is used to handle exceptions?
(catch / try / throw / all)
e) Which concept allows one class to acquire properties of another?
(polymorphism / inheritance / abstraction / encapsulation)
f) Java supports multithreading.
(True / False)
Group (B)
Attempt any TWO questions. (2×4 = 8)
Q.2 Explain constructors in Java (default and parameterized) with examples.
Q.3 Explain types of inheritance with suitable examples.
Q.4 Explain exception handling in Java using try-catch with example.
Group (C)
Attempt any ONE question. (1×6 = 6)
Q.5 Write a Java program to:
Create a class
Use constructor to initialize values
Display output
OR
Q.6 Write a Java program to:
Read a file
Handle exception using try-catch