What is synchronization? How it can be achieved?
Answers were Sorted based on User's Feedback
Answer / ravikiran(aptech mumbai)
synchronization is the process of allowing only one thread
at a time.It's been achieved by marking the method as
synchronized or locking a particular portion of code
Is This Answer Correct ? | 7 Yes | 5 No |
Answer / sainaveen
Synchronization is a mechanism used to control multiple
threads from accessing shared resources, if multiple
threads access shared resources there might be a chance for
one thread to change the shared values of another thread
leading to errors
Is This Answer Correct ? | 6 Yes | 8 No |
When you declare a method as abstract method ?
Which data type is class in java?
What is the use of anonymous inner classes ?
What do you mean by constant time complexity?
Who developed JScript language?
hi to all,i have a question on static block. i saved below as test.java class test extends a { static { System.out.println("test static"); } public static void main(String []dfs) { } } class a { static { System.out.println("a static"); } public static void main(String []asdf) { } } o/p as static test static but if i change base class as test class then class test { static { System.out.println("test static"); } public static void main(String []dfs) { } } class a extends test { static { System.out.println("a static"); } public static void main(String []asdf) { } } o/p test static explain me why "a static" wasn't print in second code when it is in derived class
Can a class have 2 constructors?
Which is fastest collection in java?
Why is string builder not thread safe?
What is the difference between Static and final?
How to count occurrences of each duplicate element in a list {a,b,d,c,a,b} ? Thanks in Advance
What do you understand by synchronization?