List listOfObjectArrays; listOfObjectArrays = new ArrayList(); Object[] objectArray = new Object[] {1, "two", null}; listOfObjectArrays.add(objectArray); // works just fine listOfObjectArrays = Arrays.asList(objectArray, objectArray); // works just fine listOfObjectArrays = Arrays.asList(objectArray); // * // compile error: Incompatible types. Required: List Found: List listOfObjectArrays = Arrays.asList(new Object[] {1, "two", null}); // compile error: Incompatible types. Required: List Found: List
List listOfObjectArrays; listOfObjectArrays = new ArrayList<>(); Object[][] objectArray = new Object[][] {{1, "two", null}}; listOfObjectArrays.add(objectArray[0]); // works just fine listOfObjectArrays = Arrays.asList(objectArray); // works just fine