Question: what is outofmemoryexception in java?
Answer: The OutOfMemoryError Exception in Java looks like this: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space. Usually, this error is thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector.