trafficlight.java

来自「交通灯路口的一个小程序,控制四个灯,其中南灯有一个外加左转灯」· Java 代码 · 共 45 行

JAVA
45
字号


import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * TrafficLight class keeps all lights
 *
 * @author Hao Chen
 * @version 1.0
 */
public class TrafficLight
{
        public int light;



  /**
   * Creates a TrafficLight class and sets the light
   *
   * @param light: the color of the light
   */
	public	TrafficLight( int light)
	{
	   this.light = light;


	}
  /**
   * Return the light type
   *
   * @param light: the color of the light
   */
	public int GetLight ()
	{
	     return light;
	}




}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?