Created
December 7, 2015 09:22
-
-
Save ProZhar/1feefa65f0e8a37d7f81 to your computer and use it in GitHub Desktop.
com.javarush.test.level10.lesson11.home08
This file contains hidden or 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
| package com.javarush.test.level10.lesson11.home08; | |
| import java.util.ArrayList; | |
| /* Массив списков строк | |
| Создать массив, элементами которого будут списки строк. Заполнить массив любыми данными и вывести их на экран. | |
| */ | |
| public class Solution | |
| { | |
| public static void main(String[] args) | |
| { | |
| ArrayList<String>[] arrayOfStringList = createList(); | |
| printList(arrayOfStringList); | |
| } | |
| public static ArrayList<String>[] createList() | |
| { | |
| //напишите тут ваш код | |
| ArrayList<String>[] arrayLists = new ArrayList[4]; | |
| for (int i = 0; i < 4; i++){ | |
| arrayLists[i] = new ArrayList<>(); | |
| for (int j = 0; j < 4; j++){ | |
| arrayLists[i].add(i + " " + j); | |
| } | |
| } | |
| return arrayLists; | |
| } | |
| public static void printList(ArrayList<String>[] arrayOfStringList) | |
| { | |
| for (ArrayList<String> list: arrayOfStringList) | |
| { | |
| for (String s : list) | |
| { | |
| System.out.println(s); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment