【汇智学堂】JAVA多线程实现的小游戏-龟兔争霸-1

创建赛道:
在这里插入图片描述

package com.huizhi;

import javax.swing.*;
import java.awt.*;

public class TwoQRun extends JFrame {

    TwoQRun(){
        setTitle("多线程:龟兔争霸");
        setBackground(Color.WHITE);
        setSize(1600, 500);
        setLocation(0, 200);
        setResizable(false);
        setVisible(true);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        ThreadA threadA=new ThreadA();
        ThreaB threaB=new ThreaB();
        ThreadC threadC=new ThreadC();

        threaB.start();
        threadA.start();
        threadC.start();
    }
}

class  ThreadA extends Thread{
    public void run(){

    }
}

class  ThreaB extends Thread{
    public void run(){

    }
}

class  ThreadC extends Thread{
    TwoQRun twoQRun=new TwoQRun();
    public void run(){
    }
}
发布了268 篇原创文章 · 获赞 47 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/weixin_39593940/article/details/103595633