Hi Friends, I am new to java. Can u explain about thread
concept.How i know one thread is locked, and how can i force
or acquire another thread for lock . Finally how to know
thread is released from lock. Explain types of lock(like
method level and block level) in thread.
Answer / ravikiran
Thread is a sequential flow of control
With the help of wait(),notify(),notifyAll() methods from
the Object class
We can force a thread to be locked by making the object to
be synchronized or putting the code inside a synchronized block
We will got to know the unlocking status with the help of
notify / notifyAll method calls.
Method level block will provide a lock for the whole method
access.Block level lock will lead to a particular portion of
a program to be get locked.
| Is This Answer Correct ? | 2 Yes | 0 No |
What is bytecode verifier?
what is interface in java? Explain
What do you mean by flow of struts?
whats the diff between jsp and servlets?
Is stringwriter thread safe?
for(i=0;i<100;i++) { int i=method();//method returns no's from 1 to 10; /* insert some stmts which can give output like no.of times numbers(1-10) returned. (for example if it returns 2 then i want output how many times 2 returned) like that i want output for no's 1 - 10 how many times each no returned. */ }
What function extracts specified characters from a string?
Why there are some null interface in java? What does it mean?
What is the importance in context in JDBC connection pools?
What is ascii format?
What is meant by local variable and instance variable?
WHAT IS THE SCOPE FOR COREJAVA...? IS JAVA ONLY CORE JAVA ?