• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MindQ's #56

 
bill bozeman
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
  • 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
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic