We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Data Structures
- Java Arraylist
- Discussions
Java Arraylist
Java Arraylist
Sort by
recency
|
801 Discussions
|
Please Login in order to post a comment
Is this jagged array question?
Hi Team, I have used this approach, let me know any updates
Scanner sc = new Scanner(System.in); int p = sc.nextInt(); List> lisOfLis = new ArrayList<>(); for(int i=0;i list1 = new ArrayList<>();
for(int j=0;j= 0 && x < p && y >= 0 && y < lisOfLis.get(x).size()){ List newlist = lisOfLis.get(x); System.out.println(newlist.get(y)); }else{ System.out.println("ERROR!"); }
}
sc.close();