• Post Reply Bookmark Topic Watch Topic
  • New Topic

incompatible types problems  RSS feed

 
Ben Hultin
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having troubles with an incompatible types issue regarding an Arraylist. I have tried a number of ways but still I cant shake the error. Mind taking a look at it?




.\Cat.java:33: incompatible types
found : Mouse
required: java.util.ArrayList<Mouse>
mice = mice.remove(selectedMouse);





I appreciate the help
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you writing mice = mice.remove(...);? Remove the "mice =":

Note: Carefully read and try to understand the error message that the compiler gives you. In this case, the error message tells you that the compiler expected a java.util.ArrayList<Mouse> object, but it found a Mouse object instead. With that in mind, carefully look at the line of code where the error is reported and try to understand what the problem is.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!