实例介绍
OCJP 1Z0-808考试资料 oca考试PDF版 1z0-808-pdf.pdf 包含oca考试所以知识点. 注意出书时间, 知识点增删可以在论坛上面查看.
pu1 c stat工ci以man〔时ring[]args){ h○上ts1 Integer s2=400; Long s3 =(long) sl s21 //line n1 string s4=〔 tring)〔s3s2):}1inen2 System. out. println(Surm is t s4) a上七 ract c1assE1anet{ protected void revolve(i 了1inen1 abst ract void rotate(〕 //line n2 class Earth extends planet i v○ id revo1ve(){ //line n3 protected v◎1dr七a七e〔){ /line n4 las hicle i string type 4啊 int maxspeed =100: ehicle (string typer int maxspeed) i this. tyl type F this. maxspeed maxs peed ass Car extends vehicle i 5七11g七上an吕 Car(string trans //line n1 this trans trans i r( string type; int. maxspeed; String七rans〕 super (type imaxspeed) 七his七rns〕 /line n2 } 7. Car cl= new Car(Auto)F 8. Car c2= new Car(4m Manual) 9. System. out. printIn(cl type + t cl. maxSpeed +:t cl. trans )i 10.吕 ystem.out.pint1n(c2.type+""+c2.max吕peed+""+c2.t工ans) l. class x public void printFilecontent ()i / code goes here * 4 throw ne硕工 OEXceptlor(); 白.} publ lass Test public static void main(String[] args)( 区xobi=newx(); o5]. printFilecontent (x 11 D A) Replace line 8 with public static void main(string[l args) throws Exception D B) Replace line 10 with: try xob. printEilecontent(5 catch(Exception e)t catch( EXception e】 D C) Replace line 2 with public void printEilecontent ( throw IOException 4 DD Replace line 4 with throw IOException("Exception raised"); D E) At line 11, insert throw new IOE*ception() public static void main(string[] args) i stringBuilder sh= new StringBuilder(5) S七r1nas if(s.eq1a⊥s〔s〕){ System. out. println(Match 1) 3 else if (sh toString().equals (s tostring ())) t System. out. println(Match 2); ystem.out. print1n↓"。 Match"〕 interface Readable i public void readBook() public void setBookMark ()i 上七工二c1 ass BooK1mp1 ements reada1e{!1inem1 public void readBook()i j i line n2 class EBook extends Book i A line n public void readBook()i 1 A line n4 C A Replace the code fragment at line n1 with class Book inplements Readable C At line n2 insert public abstract void setBookMark()F C Replace the code fragment at line n3 with ab七ac七c1 aSs ER○ extends B●k{ C D)At line n4 insert public void setBookMark()i 1 public static void main(String[] args) str⊥ngta="A"P string th:") 七且=七a,C0卫Ca七 七a=ta.C○ncat(tb) 七a,ep1ace〔 CTD); ta=ta, concat(七b)F Syste. out. println(ta)i 【实例截图】
【核心代码】
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论