Here is the question What statements about paint() method is true; a)It is protected. b)takes an instance of class Graphics. c)it is static. d)automatically called when you minimize and maximize a component such as a window. e)has a version that takes an int as a parameter. I picked b,d. The answer given in the book is C. Can someone clarify this. Thanks in advance.
Its b only when the window is minimized or maximized or some part of window is covered or uncovered repaint method is invoked from repaint method update method is invoked.Not panit method is invoked automatically.
I think b and d are correct. Option 'c' paint() method is static is certainly wrong. paint method is defined in Component class as public void paint(Graphics g); I think this Question should be moved to errata. cheers Sankar