• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

MindQ's #56

 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got this from http://www.javaranch.com/maha/_Mock_Exams/MindQ_s_Sun_Certified_Java_Programmer_Practice_Test.htm
Question #56
56. Which of the following describe the sequence of method calls that result in a component being redrawn?
a) invoke paint() directly
b) invoke update which calls paint()
c) invoke repaint() which invokes update(), which in turn invokes paint()
d) invoke repaint() which invokes paint directly
The given answer is C. I might be wrong on this one, but isn't A and B correct also. C is the preferred method of doing it, but can't you call the update() method or the paint() method also which will redraw the component.
Thanks,
Bill
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill,
Think you're right. You can call update() and paint() directly although it's not recommended.
He uses 'sequence of method calls' in the question. Probably trying to make the point that calling repaint() is the acceptable call which sets off the proper sequence.
Jane
 
Our first order of business must be this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic