독학하는 초보개발자임.

이거뭐 테마까니까 코딩이 마구마구 하고싶어지네ㅋㅎㅋ

가독성도 쩔고.

꼭깔아라 두번깔아라.

글구 웹에 HTML로 코드 올릴때 요러코롬 이쁘게 올리는 툴도 되게 많더라ㅇㅇ

단순히 코딩만 잘할게 아니라

툴 잘 쓰는법도 배워야할듯ㅇㅇ













    <code>
class Data

{

        double num=0;

        void Setnum()

        {

                num = Math.random()*1000;

        }

        double Getnum()

        {

                return num;

        }

}

class thread extends Thread

{

        Data thread_data;

        public thread(String str, Data D)

        {

                super(str);

                thread_data=D;

        }

        public void run()

        {

                try {

                        for(int i=0; i<10; i++){

                                sleep(1000);

                                thread_data.Setnum();

                                System.out.println(getName()+"쓰레드의 임의의 숫자 : "+thread_data.Getnum());

                        }

                } catch (InterruptedException e) {

                System.out.println(e.getMessage());

        }

}

        

public static class mak

{

        public void main(String[] args)

        {

                Data ddd = new Data();

                Thread t1 = new thread("첫번째", ddd);

                Thread t2 = new thread("두번째", ddd);

                Thread t3 = new thread("세번째", ddd);

                t1.start();

                t2.start();

                t3.start();

        }

}</code>