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

正文內(nèi)容

course05-對(duì)象和類(lèi)-免費(fèi)閱讀

  

【正文】 MyException f om g() MyException: Originated in g() om h()in h()h()。 throw new MyException()。 } catch(SimpleException e) { (e)。 (c)。 (c)。 } } import 。 (Received char= + c)。 } catch (sizeDeterminationFailed) { doSomething。 read the file into memory。 else proceed。 else proceed。 } catch (readFailed) { doSomething。t be closed? readFile { try { open the file。 determine its size。 public class HelloWorld { . . . } 根目錄 d:\src 源文件 d:\src\\jalpha\ 編譯 cd d:\src javac \jalpha\ class文件 d:\src\\jalpha\ 執(zhí)行 (在根目錄 ) cd d:\src java 執(zhí)行 (在其他目錄 )d:\ java –classpath d:\src 15 ? 包與 Java文件的對(duì)應(yīng)關(guān)系 包 (package) package 。 public class Circle { . . . } 包 (package) import graphics.*。 public class Circle extends Graphic implements Draggable { . . . } ? 包的命名 ? 層次結(jié)構(gòu)對(duì)應(yīng)實(shí)際的目錄結(jié)構(gòu) ? . ? . ? . 包 (package) 11 ? 包的使用 ? 只有公共的 (public)包成員 (類(lèi)、接口 )可以在其所定義的包外被訪問(wèn) ? 三種方式 ? 利用包成員的規(guī)范名 (包名 +類(lèi)名 ) ? 引入 (import)包成員名 ? 引入 (import)整個(gè)包成員 包 (package) 12 ? 例 package graphics。 … … Circle myCir = new Circle()。 class Test { … … c = new ()。. 執(zhí)行 (在其他目錄 ) d:\ java –classpath d:\src1。t be opened? ? What happens if the length of the file can39。 } catch (fileOpenFailed) { doSomething。 } method1 { errorCodeType error。 } errorCodeType method3 { errorCodeType error。 } 23 ? 為什么采用異常 (Exception) ? 對(duì)錯(cuò)誤進(jìn)行分類(lèi),針對(duì)不同錯(cuò)誤作不同處理 異常 (Exception) readFile { open the file。 read the file into memory。 class jex3_3 { public static void main(String args[]) throws IOException { char c。 } } java jex7_9 Exception in thread main“ : 0 a .NumberFormatException: For input string: “a” 27 ? 異常處理機(jī)制 ? 異常處理器 (exception handler) ? try ? catch ? finally ? 異常的拋出 (throw) 異常 (Exception) 28 ? 異常處理器 (exception handler) ? try程序塊 ? 構(gòu)造一個(gè)異常處理器,封裝一些拋出異常的語(yǔ)句 try { Java 語(yǔ)句塊 。 must be caught or declared to be thrown char c = (char)()。 class Test { static char getChar() throws IOException { char c = (char)()。 if (…) throw new SimpleException()。 } public MyException(String msg, int x) { super(msg)。 } } try { f()。 therefore, it catches any exception. This can be a poor implementation because you are losing valuable information about the type of exception being
點(diǎn)擊復(fù)制文檔內(nèi)容
物理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1