NPTEL Programming In Java Week 6 Assignment Answers 2024

Join Our WhatsApp Group Join Now
Join Us On Telegram Join Now

NPTEL Programming In Java Week 6 Assignment Answers 2024

1. What is the output of the following program?

NPTEL Programming In Java Week 6 Assignment Answers 2024

a. “Programming In Java”
b. Run time error
c. Compile time error
d. ArithmeticException

Answer :- For Answer Click Here 

2. What is the output of the following program?

NPTEL Programming In Java Week 6 Assignment Answers 2024

a. 1 3
b. 1 2 3 4
c. Runtime error
d. 1 2

Answer :-  For Answer Click Here 

3. For the program given below, what will be the output after its execution?

NPTEL Programming In Java Week 6 Assignment Answers 2024

a. 0
b. true
c. 1
d. false

Answer :-  For Answer Click Here 

4. Which of the following is a correct constructor for a thread object?

a. Thread(Runnable a, String str);
b. Thread(Runnable a, int priority);
c. Thread(Runnable a, ThreadGroup t);
d. Thread(int priority);

Answer :- 

5. What is the output of the following program?

NPTEL Programming In Java Week 6 Assignment Answers 2024

a. Compiler Error
b. “Running”
c. Runtime Exception
d. No output, but no error

Answer :- 

6. How many threads does the following program run on?

NPTEL Programming In Java Week 6 Assignment Answers 2024

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

Answer :-  For Answer Click Here 

7. In the following java program, what is the NAME of the thread?

NPTEL Programming In Java Week 6 Assignment Answers 2024

a. thread
b. main
c. system
d. None of the above

Answer :- 

8. Which of the following line(s) of code is suitable to START a thread at #1?

NPTEL Programming In Java Week 6 Assignment Answers 2024

a. Thread t = new Thread(Nptel);
b. Thread t = new Thread(Nptel);
t.start();
c. Nptel run = new Nptel();
Thread t = new Thread(run);
t.start();
d. Thread t = new Thread();
Nptel.run();

Answer :- 

9. What is the name of the priority of this Thread in this program?

NPTEL Programming In Java Week 6 Assignment Answers 2024

a. 1
b. 4
c. 0
d. 5

Answer :- 

10. What does I/O stand for in Java?

a. Input/Output
b. Inheritance/Overriding
c. Integer/Object
d. Iteration/Observation

Answer :-  For Answer Click Here