I need to check that memory was successfully allocated in the following (very, very basic) code. How do I check it? Apparently one option is to use a try....catch block. But what exactly would I be catching?
And why do I even need to check this?
public class Square { // Data members final int r = 10; final int c = 10; Cell[][] square; public Square() { square = new Cell[r][c]; } }