The code seems to run except what I am getting is not a matrix of a specified (by the user) size but what I think is a heap address
Here\'s what it returns when the user inputs
Java arrays do not override toString() so you are getting the default implementation from Object. Instead, you can use Arrays.deepToString(Object[]) like