K
K
Kirill Bazhenov2017-09-30 18:50:24
Java
Kirill Bazhenov, 2017-09-30 18:50:24

How can I randomize in a multidimensional array, 1 array?

String[][] school_supplies = {
                 {"Ручка","Карандаш"}
                ,{"Портфель","Рюкзак"}
                ,{"Учебник","Тетрадь"}

        };

// Как мне сделать рандом только ручки и карандаша?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D3lphi, 2017-09-30
@D3lphi

school_supplies[0][new Random().nextInt(school_supplies[0].length - 1)];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question