• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need a little explanation with this line of code  RSS feed

 
Syahir Jai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not understand what this line means. Especially the ArrayList<Restaurants>.

public ArrayList<Restaurants> getRestaurants(String accountKey, String uniqueId)

Any help is greatly appreciated.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on JSP. For more information, please read this.

This post has been moved to a more appropriate forum.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a method declaration (without the body, which would be inside the braces that follow).

"public" is the method's access level.

"ArrayList<Restaurants>" is the method's return type (an ArrayList of Restaurants objects). Google "Java generics" for help with this.

"getRestaurants" is the method's name.

"String accountKey" is the first method parameter (a String with a local variable name of "accountKey").

"String uniqueId" is the second method parameter (a String with a local variable name of "uniqueId").
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!