K
K
Koshkasobaka2020-04-16 22:19:46
Java
Koshkasobaka, 2020-04-16 22:19:46

How to put values ​​from an array into a HashSet?

I am writing a test that checks that there are no repeated numbers in the strings of the int [][] array. For this purpose, I want to put the values ​​of the strings in the HashSet and compare the length of the string and the resulting set.
But the compiler does not want to accept int, but requires Integer. Tell me how to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jacen11, 2020-04-17
@Jacen11

you can't put primitives in collections.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question