Review Exercises - Class 4

  1. Why doesn't the following code segment show anything?
         Picture p;
         p = new Picture(200,200);
         g = p.getGraphics();
         g.setColor(Color.blue);
         g.fillOval(200,300,50,70);
         p.repaint();
    
  2. Why doesn't the following code segment show anything?
         Picture p;
         p = new Picture(200,200);
         g = p.getGraphics();
         g.fillRect(100,100,20,40);
         p.repaint();
    
  3. What is a class variable?
  4. What is a method variable?
  5. What is an actual parameter?
  6. What is a formal parameter?
  7. What is the scope of a variable?