freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java體系結(jié)構(gòu)分析(編輯修改稿)

2025-01-31 16:14 本頁面
 

【文章內(nèi)容簡介】 led within a try block. If an exception is thrown, the try block is halted immediately. ?catch (Exception e) { … }: If an specified exception was thrown, it is caught here and the contents of the catch block are executed. If no exception was thrown in the try block, this block is ignored. P31 Java的關(guān)鍵字 ?finally {...}: This is an optional block of code that is executed. It is always executed, regardless of what happened in the trycatch portion of the block. ?Usually, the finally ponent of this block is ignored. P32 繼承 ?假如你定義一個類如下 : ?class Person ?你可以定義一個 Student類繼承 Person,如下 : ?class Student extends Person ?Student將繼承 Person的所有屬性和操作。 . P33 繼承 Abstract ?假定你有這些類 : ?abstract class Person ?class Student extends Person ?class Bowler extends Person ?你不能實例化 abstract類 . ?Person a=new Person()。 // not allowed. ?Student s=new Student()。 // Good. P34 繼承 Final ?假定你有這些類 : ?abstract class Person ?final class Student extends Person ?沒有類能夠繼承 Student. ?class NewStudent extends Student //error ?class NewStudent extends Person //OK P35 繼承高級概念 ?代碼重用 ?靜態(tài)綁定、動態(tài)綁定 ?內(nèi)存布局 P36 接口 ?一個特殊類型的類,提供了一個公共的方法列表 ?一個類可以實現(xiàn)多個接口,一個接口可以被多個類實現(xiàn) ?如果一個類實現(xiàn)自一個接口,它必須實現(xiàn)這個接口聲明的所有方法 ?接口可以繼承其它接口 P37 接口示例 ?public interface MyInterface { ?public void task1(int x, int y)。 ?public void task2(double d, String s)。 ?} ?任何實現(xiàn) MyInterface接口的類,必須實現(xiàn)task1和 task2方法,而且參數(shù)類型,順序和數(shù)量必須一致 P38 Java String ?String是 Java的一個類 . ?簡單實例化 . ?String s=“Hi There”。 ?String s=new String(“Hi There”)。 ?你可以用 +連接兩個字符串 . ?String s = “Hi ” + yourName。 P39 Java Numbers and Operators. ?Exactly same as C++ ?i++, x, a=(int)f。 ?ay, ab, a==b。 ?Type check: object instanceof class。 ?for (start, condition, next)。 ?if (condition) { } else { } ?while (condition) { } ?do { } while (condition) ?C++ switch statements supported P40 聲明和創(chuàng)建對象 ?Class ref。 ?when a variable of an object class is declared its initial value is null ?we need to declare an instance to store in ref. ?ref=new Class()。 ?Destructors are not necessary due to garbage collection. P41 例外 ?例外 (exception)是一個用來指出程序出現(xiàn)了異常條件 . ?Java定義了一個例外的基類 Exception,例外類必須直接或者間接繼承與該類 . ?例外分為 RuntimeException和普通例外,如果一個方法可能拋出 RuntimeException, 在聲明該
點擊復(fù)制文檔內(nèi)容
醫(yī)療健康相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1