You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -946,4 +946,38 @@ Generally the ArrayList is quicker than the HashTable to insert elements in some
946
946
947
947
---
948
948
949
+
### 61. You're trying to store people's info in a hash table. How would you design your key?
950
+
951
+
Will create a hashtable in which I will insert an integer id as key and Map<People> as value.
952
+
953
+
**[Back to Top](https://github.com/aatul/Java-Interview-Questions-Answers/blob/master/README.md#java-interview-questions-answers)**
954
+
955
+
---
956
+
957
+
### 62. What is the synchronized keyword and what are the different ways to use synchronized keywords?
958
+
959
+
A piece of logic marked with synchronized becomes a synchronized block, allowing only one thread to execute at any given time.
960
+
961
+
**[Back to Top](https://github.com/aatul/Java-Interview-Questions-Answers/blob/master/README.md#java-interview-questions-answers)**
962
+
963
+
---
964
+
965
+
### 63. What is a synchronized block? What is the difference between synchronized block and synchronized method?
966
+
967
+
A piece of logic marked with synchronized becomes a synchronized block, allowing only one thread to execute at any given time.
968
+
969
+
Synchronized method provides a lock corresponding to class level or object level, whereas Synchronized block provides a lock on any object depending on the parameter.
970
+
971
+
**[Back to Top](https://github.com/aatul/Java-Interview-Questions-Answers/blob/master/README.md#java-interview-questions-answers)**
972
+
973
+
---
974
+
975
+
### 64. Explain concurrent accumulators? And Concurrency in java?
976
+
977
+
Concurrent accumulator classes that enable you to very efficiently increase / decrease the value of a counter in a thread safe manner. This is really a case where it’s not a question of taste, or preference – using these new classes in your code is really a no-brainer.
978
+
979
+
**[Back to Top](https://github.com/aatul/Java-Interview-Questions-Answers/blob/master/README.md#java-interview-questions-answers)**
0 commit comments