NPTEL Programming in Java Week 12 Assignment Answers 2024
1. Execution of the following SQL command
using JDBC program will return a ResultSet object. This object is:
a. Same as the myTable.
b. All records in verbatim from the table.
c. All records in verbatim from the table but those records with null values.
d. All records in verbatim from the table but those records are not with null values.
Answer :- For Answers Click Here
2. Which of the following method is used to set a frame, f with size 300 × 200 pixels?
a. f.setSize(300, 200)
b. f.setSize(200, 300)
c. f.paint(300, 200)
d. f.setVisible(300, 200)
Answer :- For Answers Click Here
3. Consider the following program:
a. 38
b. 39
c. 40
d. 41
Answer :- For Answers Click Here
4. What is the output of the following program?
a. finally
b. exception finished
c. finally exception finished
d. Compilation fails
Answer :-
5. What is the output of the following program?
a. 00000012
b. 00000000
c. 10011001
d. 12211221
Answer :-
6. What should be the value of X and Y for the output of the below program to be 36?
a. X = 6 and Y = 5
b. X = 2 and Y = 7
c. X = 1 and Y = 10
d. X = 4 and Y = 5
Answer :- For Answers Click Here
7. Which of the following options correctly initializes the elements of the numbers array with values 1, 2, 3, 4, and 5?
Answer :-
8. Which of the following statements are correct and would NOT cause a compilation error?
a. iii, iv, v, vi
b. i, ii, iii, iv
c. ii, iii, v, vi
d. i, ii, iv, vi
Answer :-
9. What will be the output of this program?
a. true false
b. false true
c. true true
d. false false
Answer :-
10. What will be the output of this program?
a. Compilation ERROR
b. “Finally block executed”
c. “Arithmetic exception occurred Finally block executed”
d. Runtime ERROR
Answer :- For Answers Click Here