Sign Up

Sign In

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Sorry, you do not have permission to ask a question, You must login to ask a question.

SIKSHAPATH Latest Articles

NPTEL Programming In Java Week 6 Assignment Answers 2023

NPTEL Programming In Java Week 6 Assignment Answers 2023

Students, it’s time to take a closer look at the hint of programming in java NPTEL week 6 assignment answers. And, identify where you can improve your marks in this assignment.

Table of Contents

NPTEL Programming In Java Week 6 Assignment Answers

Q1. Which of the following is NOT TRUE in Java?

a. Every thread has a priority.
b. JVM allows multiple threads of execution running concurrently.
c. Threads with higher priority are executed first.
d. You cannot set a maximum priority value that a thread can have.

Answer: Option D.

1000+ students getting help from instant notifications, Join us on telegram.

Q2. Consider the following code:

class PrimeRun implements Runnable {
	long minPrime; 
PrimeRun (long minPrime) {
	this.minPrime = minPrime;
public void run() { 
// compute primes larger than minPrime

Which of the following is TRUE regarding the above code?

Answer: a. Creating a thread in Java using Runnable interface
d. The class implements the run method.

Q3. Which of the following can be used to create an instance of Thread?

a. By implementing the Runnable interface.

b. By extending the Thread class.

c. By creating a new class named Thread and calling method run().

d. By importing the Thread class from the related package.

Answer: Option C & D.

Q4. Which method start () will do which of the following?

Answer: a. Causes this thread to begin execution.

Q5. Which method start () will do which of the following?

Answer: a. Causes this thread to begin execution.

c. The JVM calls the run method of this thread.

Q6. Which of the following is not platform independent in Java?

Answer: b. The thread constructor with the stackSize parameter is platform dependent.

Q7. The following is a simple program using the concept of thread.

public class Question extends Thread { 
public void run() { 
for (int i=1;i<5;i++) {
public static void main(String args[]) { 
Question t1=new Question ();;

What is the output of the above program?

a. 1


b. 2




c. Runtime error

d. 2


Answer: Option D.

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

public class Main{
public static void main(String[] args){
Thread thread=Thread.currentThread();;
System.out.print (thread.activeCount());

a. 1

b. 10

c. 01

d. 11

Answer: d. 11

Q9. Which of the following method returns a reference to the currently executing thread object?

Answer: b. public static Thread currentThread()

Q10. Which of the following methods can be used to reduce over-utilization of CPU?

Answer: c. public static void sleep(long millis)

NPTEL Java Week 6 Programming Assignment Answers


public class Question61 extends Thread


       public void run()
		System.out.print("Thread is Running.");


public static void main(String[] args) 
        Question62 ex = new Question62();  
        Thread t0= new Thread(ex);  
        t0.setName("Main Thread");
        System.out.println("Welcome to Java Week 6 New Question.");  
        t0.setName("Main Thread");


 class MyThread extends B
	  public void run() 
    {System.out.print("NPTEL Java week-6 new Assignment Q3");}  }


public synchronized int sum()

public synchronized void inc() 
    b++;  }  }


  t1.setName("Week 6 Assignment Q5");  


  t2.setName("Week 6 Assignment Q5 New");  

Follow on Google News (in one click)Click Here

Disclaimer: These answers are provided only for the purpose to help students to take references. This website does not claim any surety of 100% correct answers. So, this website urges you to complete your assignment yourself.

Also Available:

NPTEL Programming In Java Week 5 Assignment Answers

Related Posts

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
100% Free SEO Tools - Tool Kits PRO