Previous | Home | Next |
Answer:
- process-based
- Thread-based
Answer:
- by implementing Runnable
- by extending Thread
Answer: Thread(Runnable threadob,String threadName)
Answer: run()
Q.5 What is the data type for the method isAlive() and this method is available in which class?
Answer: boolean, Thread
Answer:
- isAlive()
- join()
- resume()
- suspend()
- stop()
- start()
- sleep()
- destroy()
Q.7 What are all the methods used for Inter Thread communication and what is the class in which these methods are defined?
Answer:
- wait(),notify() & notifyall()
- Object class
Q.8 What is the mechanisam defind by java for the Resources to be used by only one Thread at a time?
Answer: Synchronisation
Answer: not possible
ob.sleep(1000)
Answer: long milliseconds
Answer: long
max-priority
min-priority
normal-priority
Answer: 10,1,5
Answer: setPriority()
Answer: main thread
(a). True
(b).False
Answer: (b).False
Answer: Higher Priority
Answer: one
Answer:
- new
- runnable
- blocked
- dead
(a). True
(b).False
Answer: (b).False
Q.20 The run() method should necessary exists in classes created as subclass of thread?
(a). True
(b).False
Answer: (a). True
Q.21 When two threads are waiting on each other and can't proceed the programe is said to be in a deadlock?
(a). True
(b).False
Answer: (a). True
Answer: join() method
(a). wait(),notify(),notifyall() are defined as final & can be called only from with in a synchronized method
(b). Among wait(),notify(),notifyall() the wait() method only throws IOException
(c). wait(),notify(),notifyall() & sleep() are methods of object class
(a). a
(b). b
(c). c
(d). a & b
(e). a,b & c
Answer: (d). a & b
Answer: low-priority
Answer: Timeslicing is the method of allocating CPU time to individual threads in a priority schedule.
Answer: Daemon thread is a low priority thread which runs intermittently in the background doing the garbage collection operation for the java runtime system.
Previous | Home | Next |