Government Polytechnic Darbhanga
Class Test – II
Branch – Computer Science & Engg. Time – 01 hour
Course – Java Programming (2418401) Full marks – 20
Semester – 4th Session – 2024-27
All questions are compulsory. Any missing/misprinted data may be assumed suitably.
Group A
Q – 1 – Answer all questions as directed (1×6=6)
a. Define JVM (Java Virtual Machine). (CO1, BL1)
b. JDK stands for ________. (a) Java Development Kit (b) Java Design Kit (c) Java
Deployment Kit (d) Java Dynamic Kit (CO1, BL1)
c. Which of the following is NOT a feature of Java? (a) Platform Independent (b) Object
Oriented (c) Pointer Arithmetic (d) Multithreaded (CO1, BL1)
d. A constructor in Java is called ________. (a) Only once at object creation (b) Every
time a method is called (c) Only when the program ends (d) Manually by the programmer
(CO2, BL1)
e. Which keyword is used to inherit a class in Java? (a) implements (b) import (c)
extends (d) inherits (CO3, BL1)
f. Full form of OOP. (CO1, BL1)
Group B
Q – 2 – Answer any two questions (4×2=8)
Q – 2. Explain the features of Java. Also differentiate between Java and C++. (CO1, BL2)
Q – 3. Explain constructors in Java with suitable examples. Differentiate between default and
parameterized constructors. (CO2, BL2)
Q – 4. Write a Java program to demonstrate the use of arrays (one-dimensional). Explain
declaration, creation, and initialization of arrays. (CO2, BL2)
Group C
Q – 3 – Answer any one question (6×1=6)
Q – 5. – Explain the concept of Inheritance in Java. Describe all types of inheritance with
suitable programs. Also differentiate between method overloading and method overriding
with examples. (CO3, BL3)
Q – 6 – Describe the structure of a Java program. Explain Java tokens (keywords, identifiers,
literals, operators). Write a Java program using all types of operators and explain operator
precedence. (CO1, BL3)