Explain about interthread communication and how it takes place in java?
Answer / Deepak Kumar Rastogi
Inter-thread communication is a mechanism that allows multiple threads to share and exchange information with each other. In Java, this can be achieved using various methods such as shared variables, synchronized methods, wait() and notify(). Shared variables are common between multiple threads and can be used for data sharing. Synchronized methods ensure that only one thread can access the method at a time. The wait() and notify() methods allow one thread to wait until another thread modifies a shared variable and notifies the waiting thread when the condition is met.
| Is This Answer Correct ? | 0 Yes | 0 No |
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
What defines function?
Can we extend the String class?
Is java se free?
Define reflection.
where the static methods will live ,on stack ? can you explain brefly
Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?
1 Answers Akamai Technologies,
How to sort array in descending order in java?
What is a nested structure?
Explain the use of shift operator in java. Can you give some examples?
What is difference between string and stringbuffer?
What is public static void main?