Tag: programming languages

Questions Related to programming languages

  1. num1= -99999 num2= 999.99

  2. num1= 0 num2= 999.99

  3. num1= -99999 num2= 99999

  4. num1= 0 num2= 99999


Correct Option: A
  1. It will run without error

  2. Runtime Error

  3. Compilation Error

  4. None of all


Correct Option: A
  1. We can invoke run() method directly to start thread

  2. If we call start() method twice, two threads will be created

  3. t.sleep(50) - it will give minimum guarantee of at least 50ms this thread will not run

  4. Thread can be still alive even after the completion of run().


Correct Option: C

If a thread goes to sleep in synchronized block. (Which one is false)

  1. it is still alive

  2. It will release all hold locks

  3. It comes to runnable state after sleep time expired

  4. No other thread can enter into the synchronized.


Correct Option: B