Exception

class ConcurrentModificationException

public class ConcurrentModificationException <: Exception {
    public init()
    public init(message: String)
}

Description: Specifies a concurrent modification exception class. Its instance is thrown if a function detects an asynchronous concurrent modification.

The container classes provided by the collection package do not support concurrent modification. Therefore, ConcurrentModificationException is thrown when some operations are performed.

Exceptions are thrown in the following typical scenarios:

  • A container is modified during the process of traversing the container using for-in (except the remove() method of HashMapIterator).
  • Content of the container where an instance of the type with short declaration period is located is modified, such as EntryView and TreeMapNode.

Parent Type:

init()

public init()

Description: Constructs an instance without exception information.

init(String)

public init(message: String)

Description: Construct an exception instance based on exception information.

Parameters:

  • message: String: exception information