Here's a Java example of how to find the average of 10 randomly generated numbers using a while loop:
Java classes that implement List interface are...
As the name suggests, HashSet and HashMap are Hashing based collections. Similarities between HashSet and HashMap are...
In a Hashing scenario, at times two different objects may have same HashCode but they may not be equal...
Queue is a FIFO data structure. FIFO stands for First In First Out. It means the element added first will be removed first...
The main differences between Array and ArrayList in Java are...
In Java, every thread belongs to a group of threads...
There is a simple way to prevent busy-waiting in Java. We can just put the current thread to sleep for given amount of time...
Java language provides some basic Atomic operations. These operations can be used to make sure that concurrent threads always see the same value...
To prevent a Deadlock from occurring at least one requirement for a deadlock has to be removed...
Livelock is a scenario in which two or more block each other by responding to an action caused by another thread...
In a priority based scheduling, Threads with lower priority get lesser time for execution than higher priority threads...
In Java we can get InterruptedException from sleep() or join() methods. Throwing InterruptedException is way to...
Java does not guarantee that Thread.sleep() will cause the thread to sleep for exactly N number of milliseconds...
The two most popular implementation of Deque interface in Java are...
We can use Collections.sort method to sort the elements of a List in natural order. To use this method, we have to make...
Java does not allow creation of array with generics as elements. ..
ListIterator can iterate in the both directions of a Collection. It maintains two pointer for previous and next element...
WeakHashMap is a class similar to IdentityHashMap. Internally, it is represented by a Hashtable...
Spring framework provides following five events for Context...