/*
* @(#)Interface.java 1.0 01/11/23
*
* You can modify the template of this file in the
* directory ..\JCreator\Templates\Template_1\Project_Name.java
*
* You can also create your own project template by making a new
* folder in the directory ..\JCreator\Template\. Use the other
* templates as examples.
*
*/
package myprojects.Interface;
import java.awt.*;
import java.awt.event.*;
class Interface extends Frame {
public Interface() {
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
}
});
}
public static void main(String args[]) {
System.out.println("Starting Interface...");
Interface mainFrame = new Interface();
mainFrame.setSize(400, 400);
mainFrame.setTitle("Interface");
mainFrame.setVisible(true);
Shape c = new Circle(10.0);
System.out.println("Area of the circle is "+c.area());
System.out.println("Perimeter of the circle is "+c.perimeter());
Shape t = new Triangle(10.0, 10.0);
System.out.println("Area of the Triangle is "+t.area());
System.out.println("Perimeter of the triangle is "+t.perimeter());
}
}
|