Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

"go to implementations" for a method in IntelliJ  RSS feed

 
Mark Richardson
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In IntelliJ, I went to ArrayList.java and looked at the following code:



I put my cursor on the add method and pressed CTRL+ALT+B (go to implementation(s))

I got a pop-up that asked me to "Choose implementation of ArrayList.add" and it gave me 9 different choices, pointing to different classes.

I know that this method belongs to java.util.ArrayList, in this code. Am I correct to assume that IntelliJ is simply telling me, "Hey, this add method that you are looking at can also be found in all these other classes!"
Is there anything more here to understand here, or not really?
 
William Barnes
Ranch Hand
Posts: 1048
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same information you can fine here: https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html ?

Not sure what/which ArrayList.java you are referring to.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15885
82
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means that IntelliJ found 9 different subclasses of ArrayList, which all have their own implementation of the add() method.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!