Q1. What is the difference between a runtime exception and a checked exception? A1. You must either catch or throw a checked exception. The unchecked exception (aka Runtime exception) does…
…Q1. What is the difference between a runtime exception and a checked exception? A1. You must either catch or throw a checked exception. The unchecked exception (aka Runtime exception) does…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
Q1. What is the maximum possible length of a Java String & how much heap space do you need to store the maximum possible String object?
A1. A Java String internally uses a char array (i.e. char[]) and the indices of an array is an integer. The maximum value of an integer is Integer.MAX_VALUE,…
Q1. What is wrong with SQLException? A1. When a SQLException occurs, you do not necessarily know what went wrong. It could be a temporary failure that correct itself with time…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
#1: ConcurrentModificationException Getting a ConcurrentModificationException when trying to modify (i.e. adding or removing an item) a collection while iterating. The following code throws a ConcurrentModificationException.
1 2 3 4 5 6 7 |
List<T> list = getListOfItems(); for (Iterator<T> iter = list. |