• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Arraylist And parameter Java

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello  Please Help me 🙏❤️

From my understanding
A method uses parameters, A caller passes arguments.
And i am just learning about arraylist

what i cant understand is what parameter means in the following syntax the bold ones

add(Object  elem)
Adds  the  object parameter to  the  list.

remove(int index)
Removes the object at the index parameter.

remove(Object elem)
Removes this object (if it’s in the ArrayList).

contains(Object elem)
Returns ‘true’ if there’s a match for the object parameter

isEmpty()
Returns ‘true’ if the list has no elements

indexOf(Object elem)
Returns either the index of the object parameter, or -1

size()
Returns the number of elements currently in the list

get(int  index)
Returns  the  object  currently  at  the  index  parameter

I am confused what does object parameter and index parameter means??
 
Marshal
Posts: 69411
276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please always tell us where such information comes from. Is it from the documentation for the API? It doesn't look like what appears here for List.
It means simply that it uses the parameter to which an argument is sent, and that parameter is an int, or an Object. At least that is what it looks like to me.
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic