Can someone tells my what is wrong?

public class Solution {

public static HashSet<Integer> createSet()
{
    HashSet<Integer> set = new HashSet<Integer>();

    int[] licz={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};

    for(Integer liczba : licz)
    {
        set.add(liczba);
    }
    return set;
}

public static HashSet<Integer> removeAllNumbersMoreThan10(HashSet<Integer> set)
{
    for(Integer nazwa : set)
    {
        if(nazwa>10) set.remove(nazwa);
    }
    return set;
}

}

asked 28 Mar, 18:37

MasterOwo's gravatar image

MasterOwo
1
accept rate: 0%

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×51
×18
×12

Asked: 28 Mar, 18:37

Seen: 133 times

Last updated: 28 Mar, 18:37