2.6 Suppose we create a two-dimensional array (literally, an array in which each element is an array). The following creates an int array with 50000 rows and 100000 columns: int [ ][ ] a = new int [50000][100000]; If this code is executed, the program terminates abnormally, and the message is java.lang.OutOfMemoryError Exception in thread "main" Why wasn't memory re-allocated by the garbage collector? Hypothesize whether this abnormal termination be handled with a try-block and catch-block. Test your hypothesis and explain. | |
| View Solution | |
| << Back | Next >> |