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

To create a public generic method named "update" that has no return type. In its argument list, the method accepts an argument named "updateValue" which is of the same type as the type parameter - T. Which is a valid declaration?

  1. public T update()

  2. public void update(T updateValue)

  3. void update(T updateValue)

  4. public void update()


Correct Option: B
  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
  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