Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Issue with one flashcard - Sybex Online Study Materials

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Good morning.

I bought the OCA/OCP Study Guide from Amazon.
I would like to say much thanks for Scott and Jeanne for creating such a great book.

One of the online flashcards on the Sybex website somehow confused me since as far as I know, Java passes method parameters/arguments by value.

This is the flashcard:

When passing an ArrayList list to a method, calling list = new ArrayList() from the method affects the caller.

False. Parameters are passed by reference so reassignments do not affect the caller.

I do understand, that reference re assignments do not affect the caller, but the phrase "parameters are passed by reference" confuses me.

Hope anyone shed light to this.

Posts: 69894
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please check here, and here for errata. You are correct that it should read pass by value.
    Bookmark Topic Watch Topic
  • New Topic