0

I have the method below in my class

     public void doNothing(Map<String, Collection<? extends Number>> value) {

      }

and I'm calling this method with the parameter below.

    private void loader() {
       Map<String, ArrayList<Integer>> map = null;
       doNothing(map);
    }

I get the error below.

   The method doNothing(Map<String,Collection<? extends Number>>) in the 
   type Lesson1<E> is not applicable for the arguments 
   (Map<String,ArrayList<Integer>>)

However if I changed the method to,

    public void doNothing(Collection<? extends Number> something) {

    }

and call it like below then there is no error.

    private void loader() {
        doNothing(new ArrayList<Integer>());
    }

Can someone help me the problem with using the first method which takes in a map as an argument?

Thanks!!!

JavaNovice
  • 1,083
  • 1
  • 12
  • 20

0 Answers0