IT十八掌掌第十七天课程总结

今天学完IT十八掌第十七天java基础课程:


学习内容:


多线程主要应用场景是创建灵活响应的桌面程序。


Socket : 

----------------------

    1.ServerSocket                //侦听

        ServerSocket ss = new ServerSocket(port);    //0-1023

        Socket socket = ss.accept();                //


服务器

-----------------

    1.接收sock

    2.接收client的消息.

    3.推送消息给所有人。



客户端

----------------

    1.建立连接

    2.接收Server的联系人列表,更新好友列表

    3.写入数据到服务器.

    4.


[192.168.12.34]

    \thello world



java设计模式:针对某一问题,专家级的解决方案。

---------------------------------------------

    1.单例模式:        //单一实例.

        [懒汉式]

        class Trash{

            private static Trash instance ;

            public static Trash getInstance(){

                if(instance == null){

                    instance = new Trash();

                }

                return instance ;

            }

            private Trash(){

            }

        }


        [饿汉式]

        class Trash{

            private static Trash instance = new Trahs();

            public static Trash getInstance(){

                return instance ;

            }

            private Trash(){

            }

        }




遇到的问题:

需要帮助的问题


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章