这段时间在看马士兵的j2se基础。把各章的总结发出来(2)

来源:互联网 发布:怎样做一个域名服务器 编辑:程序博客网 时间:2024/05/18 18:46

第四章  异常{

 1 异常是运行期间出现的错误
   有catch 就catch走  没有就抛出   
 
 }

第四章复习:{

 一个图

    throwable  :error
                 Exception: Runtime Exception(可以不写)
                             其他(必须处理)
五个关键字
 try
 catch
 throw
 throws
 finally
 
先逮小的后大的
异常和重写的关系
重写的方法 抛出异常了  就必须抛出一样的异常或不抛出


第五章 数组:{

数组的内存布局    一小块内存指向一大块内存的 引用
常见算法


第六章{

 java.lang.String 代表不可变的字符序列

String 相关类
基础数据类型包装类
int  integer...
Math   生成个随机数
File   
  递归
枚举类型
APi!!!!!

第七章 容器{

   1136  一个图 一个类(Collections)
          三个知识点 For(非重点) Generic Auto-boxing/unboxing
   六个接口
         
              Set
              List
  Collection  map
              Iterator
              Comparable   泛型


第八章 流{


包在个流上  一个管子插进去

管子上再包管子  

Inputstream    Outputstream

Reader Writer

FileInputStream .... out

FileReader  ....

BufferedInputstream  ....

Bytearrayinputstream

Inputstreamreader

Datainputstream

PrintStream

Objectinputstream



第九章线程{

线程是 一个程序里不同的执行路径

线程的启动必须执行 Thread的start方法

能使用接口 就不要使用Thread类继承

创建和使用线程  
从Thread继承 重写run方法
public class TestThread1 {
    public static void main(String args[]) {
        Runner1 r = new Runner1();
        Thread t = new Thread(r);
        t.start();
        
        for(int i=0; i<100; i++) {
            System.out.println("Main Thread:------" + i);
        }
    }
}

class Runner1 implements Runnable {
    public void run() {
        for(int i=0; i<100; i++) {    
            System.out.println("Runner1 :" + i);
        }
    }
}



实现Runnable接口 实现Run方法
public class TestThread1 {
    public static void main(String args[]) {
        Runner1 r = new Runner1();
        r.start();
        for(int i=0; i<100; i++) {
            System.out.println("Main Thread:------" + i);
        }
    }
}
class Runner1 extends Thread {
    public void run() {
        for(int i=0; i<100; i++) {    
            System.out.println("Runner1 :" + i);
        }
    }
}









sleep



join



yield


synchronized  锁定


wait   让自己休息


notify  叫醒 wait的




第十章{

网络协议分层思想


Ip 的概念


TCP/UDP的概念


TCP/UDP的写法

知识点的融会贯通


TCP 的固定写法

第十一章 gui{

布局管理器
       GridLayout
Frame  BorderLayout 东西南北中
Panel  FlowLayout   上下左右






Component  包涵Container
Container还能用Component

Container 包涵 Window Panel
Window包涵 Frame Dialog
Dialog 包涵、


内部类:
好处:可以方便访问包装类的成员
       可以更清楚的组织编辑,防止不应该被其他类访问的类进行访问、

何时用  该类不允许或不需要其他类进行访问时



原创粉丝点击