Created
October 17, 2022 07:10
-
-
Save XDo0/ba0bebb6e71428ecf6cfb95dac55da6a to your computer and use it in GitHub Desktop.
initialize data structure in java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java Init an array of List | |
ArrayList[] graphArrayList = new ArrayList[4]; | |
for(int i=0;i<graphArrayList.length;i++){ | |
graphArrayList[i] = new ArrayList(); //数组的每一个元素都要new一个List对象,来初始化 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment