Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Confused??? w/ Sample Code

 
Ranch Hand
Posts: 458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please tell me if I'm correct in thinking there's something wrong with this example. I found in the "Complete Java 2 Certification Guide"
Button btn;
btn = new Button("Pink");
changer(btn);
System.out.println(btn.getLabel());
public void changer(Button replaceMe) {
changeMe.setLabel("Blue");
}
Shouldn't changeMe and replaceMe be the same name?
Thanks
[This message has been edited by Ray Marsh (edited April 28, 2001).]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should report that error.
Hopefully, the publisher will be able to fix that in the next printing.
 
Ray Marsh
Ranch Hand
Posts: 458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks.
Will do, it confused me at first. I thought I was missing something, but the longer I looked at it the more I became convinced it was a typo. One of the variable names was used in a previous example.
 
reply
    Bookmark Topic Watch Topic
  • New Topic