Q7
Single choice
Click the Exhibit button.
Given the GameCanvas code:
10. public void run() {
11. try {
12. Graphics g = getGraphics();
13. Image dog = Image.createImage("/dog.png");
14. Sprite s = new Sprite(dog, 98, 88);
15. s.setPosition(0,0);
16. while (gameActive) {
17. s.setFrame(0);
18. s.paint(g);
19. flushGraphics();
20. s.setFrame(1);
21. s.paint(g);
22. flushGraphics();
23. }
24. } catch (Exception ex) {
25. //...
31. }
32. }
Assuming that gameActive is true, and that run() is called as a result of a new thread's start() invocation, what is the result?
