8 kyu
Weird Java Array
784trashy_incel
Description:
I want to create an array of List
s of Integers
, like so:
import java.util.*;
class Codewarrior {
public static List<Integer>[] arrayOfLists = new List<Integer>[] {
Arrays.asList(1, 2, 3),
Arrays.asList(4, 5, 6),
Arrays.asList(7, 8, 9),
};
}
However, this code does not compile :(
Can you fix the code ?
arrayOfLists
should hold the 3 lists shown above, (1, 2, 3), (4, 5, 6), (7, 8, 9)
.
Debugging
Puzzles
Language Features
Similar Kata:
Stats:
Created | Mar 30, 2024 |
Published | Oct 4, 2024 |
Warriors Trained | 2234 |
Total Skips | 95 |
Total Code Submissions | 1909 |
Total Times Completed | 784 |
Java Completions | 784 |
Total Stars | 8 |
% of votes with a positive feedback rating | 76% of 66 |
Total "Very Satisfied" Votes | 40 |
Total "Somewhat Satisfied" Votes | 20 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 6 |
Average Assessed Rank | 8 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |