In “How HashMap works in Java“, we learned the internals of HashMap or ConcurrentHashMap class and how they fit into the whole concept. But when the interviewer asks you about HashMap related concepts, he does not stop only on the core concept. The discussion usually goes in multiple d...
In my previous post related to “How HashMap works in java“, I explained the internals of HashMap class and how they fit into whole concept. But when interviewer ask you about HashMap related concepts, he does not stop only on core concept. The discussion usually goes in multiple directio...
9. Difference betweenHashtableandHashMapin Java? (former is thread-safe and doesn't allow null, later is not thread-safe, former is also slow because of whole locking of Map, whileHashMapis fast because of no locking,read more) 10. Difference betweenArrayListandLinkedListin Java? (former i...
Stringis a class in Java and is defined in thejava.langpackage. It’s not a primitive data type likeintandlong. TheStringclass represents character strings.Stringis used in almost all Java applications.Stringin immutable and final in Java and the JVM uses a string pool to store all theStri...
Java Collections Interview Questions and AnswersWhat are Collection related features in Java 8? Java 8 has brought major changes in the Collection API. Some of the changes are: Java Stream API for collection classes for supporting sequential as well as parallel processing Iterable interface is ...
Looking to hire a Java developer? We’re here to help!We’ve brought together a team of highly skilled Java experts to create a set of ready-made Java programming questions you can use in your interview process.These Java interview questions have everything you need for a face-to-face ...
Looking forward to appear in Java Interview, here are the key Java Interview Questions with Answers only for you. - aatul/Java-Interview-Questions-Answers
You are expected to know ConcurrentHashMap in more depth. There are plenty of concepts in this single class alone. 1.6.Java Collections Interview Questions Should I recommend you to prepare theCollection frameworkand all of its main classes? I guess you are already intelligent enough. ...
10) What happens if we add the same key with different values to a HashMap? The new value replaces the old one because HashMap doesn't allow duplicate keys. 11) What is the use of load factor? The load factor in collections such as HashMap determines when the table should be resized...
Java provides the “Map” interface with both a concrete “HashMap” and “TreeMap” implementation. HashMap is not thread safe and allows keys to be of type “null.” The special type “Hashtable” is thread safe and only allows non-null keys. TreeMap’s implementation is based on the...