Answers for "how to create a sublist in java"

0

how to create a sublist in java

// Create a list of Strings with [2] rows, and [5] columns
String[][] listOfStrings = new String[2][5];
// Create a list of integers with [1] row, and [2] columns
int[][] listOfInts = new int[1][2];


// How you add stuff to the list (Do inside a method in your class)
listOfStrings[0][0] = "The"; // Will fill index 0 of the nested list at index 0 
listOfStrings[0][1] = "Cake";
listOfStrings[0][2] = "is";
listOfStrings[0][3] = "a";
listOfStrings[0][4] = "lie";
Posted by: Guest on February-09-2022

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language