You are on page 1of 3

Raghunathpur Govt.

Polytechnic
1st Internal
CST- 3 Year- 5th Semester
rd

Time- 45 Min Subject- Java Programming FM- 20

Answer ALL questions from Section A and any THREE (3) from Section B

Section A (1 x 5 =
5)

1. What is the extension of compiled java source code file?


a) .js
b) .txt
c) .class
d) .java

2. Which component is used to compile, debug and execute java programs?


a) JRE
b) JIT
c) JDK
d) JVM

3. What will be the output of the following Java code?

public class increment {


public static void main(String args[])
{
int g = 3;
System.out.print(++g * 8);
}
}
a) 32
b) 33
c) 24
d) 25

4. What is NOT the use of “this” keyword in Java?


a) Referring to the instance variable when a local variable has the same name
b) Passing itself to the method of the same class
c) Passing itself to another method
d) Calling another constructor in constructor chaining

5. When is the finalize() method called?


a) Before garbage collection
b) Before an object goes out of scope
c) Before a variable goes out of scope
d) None

Section B

1. What do you understand by JVM, JRE, and JDK? 5

2. Explain different types of access modifiers in Java. 5

3. What is inheritance in Java? Does Java support multiple inheritance? Explain. 2+3

4. Write a program in Java to calculate the volume of a cube. Use parameterized


constructors to initialize the dimensions of the box. 5

5. Write a Java program to print Fibonacci series. 5

6. Write a program in Java to check if a number is a prime number or not. 5

 Subject line of mail should contain: “Java Programming 1st internal”.


 Save your PDF file with your name only.
 Link of the Google Drive to upload answer script will be provided during exam.

You might also like