Clay Shell Version 2

Version 2 of the Clay Shell program is behaviorally like version 1, except that it makes the background of the frame blue. Structurally it is different in that a new class which extends the frame class is defined and used.

Demos

Code

package clay2;

import java.awt.*;

public class Main {
    
    public Main() {
    }
    
    public static void main(String[] args) {
       ClayFrame frame = new ClayFrame("Clay",Color.BLUE);
    }
    
}

class ClayFrame extends Frame
{
    public ClayFrame(String title, Color color) {
        super(title);
        setSize(400,200);
        setBackground(color);
        setVisible(true);
    }
}


Questions

  1. What does it mean for a class to extend another class?
  2. What can you say about the ClayFrame constructor?
  3. Are both classes defined for this application contained within the same file? What are the names of the classes? What is the name of the file?
  4. What is "super"?