Disclosure: This article may contain affiliate links. When you purchase, we may earn a small commission.

What is difference between HashMap and Hashtable in Java?

HashMap vs Hashtable in Java
Though both Hashtable and HashMap are data-structure based upon hashing and implementation of Map interface, the main difference between them is that HashMap is not thread-safe but Hashtable is thread-safe. This means you cannot use HashMap in a multi-threaded Java application without external synchronization. Another difference is HashMap allows one null key and null values but Hashtable doesn't allow null key or values. Also, the thread-safety of the hash table is achieved using internal synchronization, which makes it slower than HashMap.

Difference between List and Set in Java Collection? Example

What is the difference between List and Set in Java is a very popular Java collection interview question and an important fundamental concept to remember while using the Collections class in Java. Both List and Set are two of the most important Collection classes Java Program use along with various Map implementations. The basic feature of List and Set are abstracted in the List and Set interface in Java and then various implementations of List and Set adds specific features on top of that e.g. ArrayList in Java is a List implementation backed by Array while LinkedList is another List implementation that works like linked list data-structure.

Top 10 Online Courses to Learn Web 3 in 2023 - Best of Lot

Hello guys, if you want to learn Web3 technology and looking for best online resources like online courses and tutorial then you have come to the right place. Earlier, I have shared 10 free Web3 tutorials and in this article, I am going to share 10 best online courses to learn Web3 in 2023. But, before getting to the 10 best courses that you can use to learn more about Web3, let me tell you more about what it really is.  Web3 is basically used to refer to a new kind of internet service that can be built using decentralized blockchains. These blockchains can be seen as shared ledger systems that can be used by cryptocurrencies like Ethereum and Bitcoin.

Top 5 Courses For ISTQBA Certified Tester in 2023 - Best of Lot

Hello guys, if you want to become a ISTQBA certified Tester and looking for best online resources like online courses then you have come to the right place. In this article, I am going to share 5 best online courses for ISTQBA certification. But, before we get to the 5 best courses that will teach you everything you need to pass the ISTQB certification, let me tell you a little bit more about what it really is. ISTQB stands for International Software Testing Qualifications Board. It is basically an institution that offers internationally recognized certifications. These certifications are called 'ISTQB Certified Tester'.

Top 5 courses to learn Solr in 2023 - Best of Lot

Hello guys, if you want to learn Solr and looking for best resources like online courses then you have come to the right place. Solr is a search platform that is open-source and may be used to create search apps. It was constructed on top of Lucene (full text search engine). Solr is an enterprise-ready, fast, and scalable search engine. Solr-based apps are smart and provide excellent performance.  Hadoop and Solr may work together. Solr assists us in discovering the essential information from such a vast source since Hadoop manages a large volume of data. Solr may be used for more than just searching. It can also be used to store data. It is a non-relational data storage and processing technique, like other NoSQL databases. In a nutshell, Solr is a scalable, ready-to-use search/storage engine that is geared for searching massive amounts of text-based data.

Difference between Wait and Sleep, Yield in Java? Example

The difference between wait and sleep or the difference between sleep and yield in Java is one of the popular core Java interview questions and asked on multi-threading interviews. Out of three methods that can be used to pause a thread in Java, sleep() and yield() methods are defined in thread class while wait() is defined in the Object class, which is another interview question. The key difference between wait() and sleep() is that the former is used for inter-thread communication while later is used to introduced to pause the current thread for a short duration. This difference is more obvious from the fact that, when a thread calls the wait() method, it releases the monitor or lock it was holding on that object, but when a thread calls the sleep() method, it never releases the monitor even if it is holding. 

What is Timer and TimerTask in Java – Tutorial Example

Timer in Java is a utility class that is used to schedule tasks for both one time and repeated execution. Timer is similar to the alarm facility many people use in mobile phones. Just like you can have one time alarm or repeated alarm, You can use java.util.Timer to schedule a time task or repeated task. In fact, we can implement a Reminder utility using Timer in Java and that's what we are going to see in this example of Timer in Java. Two classes java.util.Timer and java.util.TimerTask is used to schedule jobs in Java and forms Timer API. The TimerTask is an actual task that is executed by Timer. Similar to Thread in JavaTimerTask also implements the Runnable interface and overrides run method to specify a task details. 

Difference between Thread vs Runnable interface in Java

Thread vs Runnable in Java is always been a confusing decision for beginnerin java. Thread in Java seems easy in comparison to Runnable because you just deal with one class java.lang.Thread while in case of using Runnable to implement Thread you need to deal with both Thread and Runnable two classes. though the decision of using Runnable or Thread should be taken considering differences between Runnable and Thread and the pros and cons of both approaches.

What is Daemon thread in Java and Difference to Non daemon thread - Tutorial Example

Daemon thread in Java is those thread that runs in the background and is mostly created by JVM for performing background tasks like Garbage collection and other housekeeping tasks. The difference between Daemon and Non-Daemon (User Threads)  is also an interesting multi-threading interview question, which is asked mostly on fresher level java interviews. In one line main difference between daemon thread and user thread is that as soon as all user threads finish execution java program or JVM terminates itself, JVM doesn't wait for daemon thread to finish their execution.