




已閱讀5頁,還剩27頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
題目 以下代碼 1 public class TestString1 2 public static void main String args 3 String str 420 4 str 42 5 System out print str 6 7 輸出什么 以下代碼 1 public class Test 2 public static void main String args 3 int x 5 4 boolean b1 true 5 boolean b2 false 6 7 if x 4 9 System out print 2 10 if b2 true 12 13 運(yùn)行結(jié)果是什么 以下代碼 22 public void go 23 String o 24 z 25 for int x 0 x 3 x 26 for int y 0 y 2 y 27 if x 1 break 28 if x 2 29 o o x y 30 31 32 System out println o 33 go 方法被調(diào)用后 產(chǎn)生什么結(jié)果 以下代碼 10 int x 0 11 int y 10 12 do 13 y 14 x 15 while x 5 16 System out print x y 運(yùn)行結(jié)果是 以下代碼 1 public class Breaker 2 static String o 3 public static void main String args 4 z 5 o o 2 6 for int x 3 xdistance story 2 tail 7 System out print 1 8 if distance 1 tail story 2 distance 9 System out print 2 10 11 運(yùn)行結(jié)果是 以下代碼 1 import java util 2 public class Quest 3 public static void main String args 4 String colors 5 blue red green yellow orange 6 Arrays sort colors 7 int s2 Arrays binarySearch colors orange 8 int s3 Arrays binarySearch colors violet 9 System out print s2 s3 10 11 運(yùn)行結(jié)果是 以下代碼 1 class Alligator 2 public static void main String args 3 int x 1 2 3 4 5 6 7 8 9 4 int y x 5 System out print y 2 1 6 7 運(yùn)行結(jié)果是 以下代碼 1 public class Barn 2 public static void main String args 3 new Barn go hi 1 4 new Barn go hi world 2 5 6 public void go String y int x 7 System out print y y length 1 8 9 運(yùn)行結(jié)果是 以下代碼 5 class Atom 6 Atom System out print atom 7 8 class Rock extends Atom 9 Rock String type System out print type 10 11 public class Mountain extends Rock 12 Mountain 13 super granite 14 new Rock granite 15 16 public static void main String a new Mountain 17 運(yùn)行結(jié)果是 以下代碼 1 class X 2 X System out print 1 3 X int x 4 this 5 System out print 2 6 7 8 public class Y extends X 9 Y 10 super 6 11 System out print 3 12 13 Y int y 14 this 15 System out println 4 16 17 public static void main String a new Y 5 18 運(yùn)行結(jié)果是 以下代碼 1 public class A 2 public void doit 3 4 public String doit 5 return a 6 7 public double doit int x 8 return 1 0 9 10 運(yùn)行結(jié)果是 以下代碼 1 public class Base 2 public static final String FOO foo 3 public static void main String args 4 Base b new Base 5 Sub s new Sub 6 System out print Base FOO 7 System out print Sub FOO 8 System out print b FOO 9 System out print s FOO 10 System out print Base s FOO 11 12 13 class Sub extends Base public static final String FOO bar 運(yùn)行結(jié)果是 以下代碼 21 abstract class C1 22 public C1 System out print 1 23 24 class C2 extends C1 25 public C2 System out print 2 26 27 class C3 extends C2 28 public C3 System out print 3 29 30 public class Ctest 31 public static void main String a new C3 32 運(yùn)行結(jié)果是 以下代碼 1 public class KungFu 2 public static void main String args 3 Integer x 400 4 Integer y x 5 x 6 StringBuilder sb1 new StringBuilder 123 7 StringBuilder sb2 sb1 8 sb1 append 5 9 System out println x y sb1 sb2 10 11 運(yùn)行結(jié)果是 1 class A 2 public String doit int x int y 3 return a 4 5 6 public String doit int vals 7 return b 8 9 給出以下代碼 運(yùn)行產(chǎn)生什么結(jié)果 25 A a new A 26 System out println a doit 4 5 以下代碼 1 package test 2 3 class Target 4 public String name hello 5 可以直接訪問和修改name變量值的是 以下代碼 11 abstract class Vehicle public int speed return 0 12 class Car extends Vehicle public int speed return 60 13 class RaceCar extends Car public int speed return 150 21 RaceCar racer new RaceCar 22 Car car new RaceCar 23 Vehicle vehicle new RaceCar 24 System out println racer speed car speed 25 vehicle speed 運(yùn)行的結(jié)果是 關(guān)于以下代碼 5 class Building 6 public class Barn extends Building 7 public static void main String args 8 Building build1 new Building 9 Barn barn1 new Barn 10 Barn barn2 Barn build1 11 Object obj1 Object build1 12 String str1 String build1 13 Building build2 Building barn1 14 15 哪一個(gè)是正確的 以下代碼 21 class Money 22 private String country Canada 23 public String getC return country 24 25 class Yen extends Money 26 public String getC return super country 27 28 public class Euro extends Money 29 public String getC return super getC 30 public static void main String args 31 System out print new Yen getC new Euro getC 32 33 運(yùn)行結(jié)果是 以下代碼 10 interface Foo 11 class Alpha implements Foo 12 class Beta extends Alpha 13 public class Delta extends Beta 14 public static void main String args 15 Beta x new Beta 16 insert code here 17 18 以下哪個(gè)代碼插入第16行會拋出java lang ClassCastException異常 以下代碼 31 class Foo 32 public int a 3 33 public void addFive a 5 System out print f 34 35 class Bar extends Foo 36 public int a 8 37 public void addFive this a 5 System out print b 38 通過以下調(diào)用 Foo f new Bar f addFive System out println f a 運(yùn)行的結(jié)果是 Given 1 class TestA 2 public void start System out println TestA 3 4 public class TestB extends TestA 5 public void start System out println TestB 6 public static void main String args 7 TestA new TestB start 8 9 What is the result 以下代碼 10 class Nav 11 public enum Direction NORTH SOUTH EAST WEST 12 13 public class Sprite 14 insert code here 15 以下哪個(gè)代碼插入在14行 可以讓Sprite class編譯通過 以下代碼 5 class Payload 6 private int weight 7 public Payload int w weight w 8 public void setWeight int w weight w 9 public String toString return Integer toString weight 10 11 public class TestPayload 12 static void changePayload Payload p insert code 13 public static void main String args 14 Payload p new Payload 200 15 p setWeight 1024 16 changePayload p 17 System out println p is p 18 哪個(gè)代碼片段插入12行 使程序?qū)嵭薪Y(jié)果為420 以下代碼 11 public static void test Sting str 12 int check 4 13 if check str length 14 System out print str charAt check 1 15 else 16 System out print str charAt O 17 18 通過下列調(diào)用 執(zhí)行結(jié)果是什么 21 test four 22 test tee 23 test to 以下代碼 15 public class Pass2 16 public static void main String args 17 int x 6 18 Pass2 p new Pass2 19 p doStuff x 20 System out print main x x 21 22 23 void doStuff int x 24 System out print doStuff x x 25 26 在命令行輸入以下指令 產(chǎn)生什么結(jié)果 javac Pass2 java java Pass2 5 String s new String 1 String t new String 1 則執(zhí)行語句System out println s t 的輸出結(jié)果為 如果A類繼承B類則下列哪個(gè)說法最可能是正確的 執(zhí)行下列代碼后變量a的值為 boolean a false boolean b false 下列java程序設(shè)計(jì)中編譯錯(cuò)誤的是 在類中入口方法main的寫法正確的為 下列關(guān)于double long float類型可表示的數(shù)值范圍的大小順序正確的是 執(zhí)行下列語句后輸出的結(jié)果為 int a 0 while a 10 a System out println a 執(zhí)行下列語句輸出的結(jié)果為 int a 6 if a 5 if a 5 System out println a5 下列哪個(gè)選項(xiàng)是java語言所不具備的 以下哪個(gè)是Runnable接口中定義的方法 抽象方法定義和常量值的集合是 下列不屬于條件控制語句的是 下列說法正確的是 選項(xiàng) 42 420 462 42042D 2 3 1 2 2 3D 00 001 000120C 00012021 編譯錯(cuò)誤 5 6 5 5B 6 5 6 6 23 234 235 2345 2357 23457 編譯錯(cuò)誤 1 2 12 編譯錯(cuò)誤 沒有輸出E 運(yùn)行時(shí)發(fā)生異常 2 1 2 4 2 5C 3 1 3 4 3 5 編譯錯(cuò)誤 運(yùn)行時(shí)發(fā)生異常 2 3 4 6 7E 編譯錯(cuò)誤 hi hi hi world world world 編譯錯(cuò)誤D 運(yùn)行時(shí)發(fā)生異常 編譯錯(cuò)誤 atom granite grantie granite atom granite granite 運(yùn)行時(shí)發(fā)生異常 atom granite atom graniteF 13 134 1234C 2134 2143 4321 運(yùn)行時(shí)發(fā)生異常 第七行錯(cuò)誤 第四行錯(cuò)誤C 編譯正確 運(yùn)行正常 foofoofoofoofoo foobarfoobarbar foobarfoofoofoo foobarfoobarfooD barbarbarbarbar foofoofoobarbar foofoofoobarfoo 3 23 32 123D 321 true true false trueB true false false false 編譯錯(cuò)誤 運(yùn)行時(shí)發(fā)生異常 A Line 26 prints a to System out A B Line 26 prints b to System out 運(yùn)行時(shí)發(fā)生異常 第6行編譯錯(cuò)誤 any class only the Target class any class in the test packageC any class that extends Target 0 0 0 150 60 0 編譯錯(cuò)誤 150 150 150D 運(yùn)行時(shí)發(fā)生異常 如果刪除第十行 編譯可以通過 如果第11行刪除 編譯可以通過 如果第12行刪除 編譯可以通過C 如果第13行刪除 編譯可以通過 以上答案都不正確 Canada null Canada Canada null Canada Canada 第26行編譯錯(cuò)誤E 第29行編譯錯(cuò)誤 Alpha a x Foo f Delta x B Foo f Alpha x Beta b Beta Alpha x b 3A b 8 b 13 f 3 f 8 f 13 TestA TestBB 編譯錯(cuò)誤 運(yùn)行時(shí)發(fā)生異常 Direction d NORTH Nav Direction d NORTH Direction d Direction NORTH Nav Direction d Nav Direction NORTH D p setWeight 420 A p changePayload 420 p new Payload 420 Payload setWeight 420 p Payload setWeight 420 r t t r e o 編譯錯(cuò)誤C 運(yùn)行時(shí)發(fā)生異常 Compilation fails An exception is thrown at runtime doStuff x 6 main x 6D doStuff x 6 main x 7 doStuff x 7 main x 6 doStuff x 7 main x 7 1 0 true FALSED A類被稱之為父類 B類被稱之為子類 A類的特性多余B類C B類的特性多余A類 FALSEA true 0 1 if 3 5 System out println hello if false System out println hello if 5 3 System out println hello if 0 System out println hello D public static void main public static void main char c public void main public static void main String args D double floate longA double long float long double float long float double 0 1 10C 9 a5 a5兩條輸出 什么也不會輸出D 封裝 繼承 跨平臺 無需編譯D static run B stop yield 單元 接口B 成員 變量 for語句A if語句 if else語句 if語句的擴(kuò)展形式 不需定義類 就能創(chuàng)建對象 屬性可以是簡單變量 也可以是一個(gè)對象B 屬性必須是簡單變量 對象中必有屬性和方法 題目 以下代碼 10 interface Jumper public void jump 20 class Animal 30 class Dog extends Animal 31 Tail tail 32 40 class Beagle extends Dog implements Jumper 41 public void jump 42 50 class Cat implements Jumper 51 public void jump 52 以下語句哪三條是正確的 以下代碼 10 class One 11 void foo 12 13 class Two extends One 14 insert method here 15 在14行處單獨(dú)插入以下哪些個(gè)方法才能讓兩個(gè)Class編譯通過 以下代碼 1 class Mammal 2 3 class Raccoon extends Mammal 4 Mammal m new Mammal 5 6 7 class BabyRaccoon extends Mammal 哪四條語句是正確的 以下代碼 1 class One 2 public One foo return this 3 4 class Two extends One 5 public One foo return this 6 7 class Three extends Two 8 insert method here 9 單獨(dú)插入哪些方法可以成功編譯三個(gè)class 以下代碼 1 class Employee 2 String name double baseSalary 3 public Employee String name double baseSalary 4 this name name 5 this baseSalary baseSalary 6 7 8 public class SalesPerson extends Employee 9 double commission 10 public SalesPerson String name 11 double baseSalary double commission 12 insert code here 13 14 在12行處單獨(dú)插入哪些代碼 可以讓程序編譯通過 以下代碼 1 public abstract class Shape 2 private int x 3 private int y 4 public abstract void draw 5 public void setAnchor int x int y 6 this x x 7 this y y 8 9 正確使用Shape類的是 以下代碼 11 public interface Status 12 insert code here int MY VALUE 10 13 以下哪些代碼插入在12行處是合法的 以下代碼 10 abstract class A 11 abstract void a1 12 void a2 13 14 class B extends A 15 void a1 16 void a2 17 18 class C extends B void c1 和 A x new B C y new C A z new C 哪些是合法的多態(tài)方法調(diào)用 以下哪些代碼片段是合法的讀取Console 一行文本的方法 下列說法錯(cuò)誤的有 選項(xiàng) Cat is a Animal Cat is a Jumper1 Dog is a Animal1 Dog is a Jumper Cat has a Animal Beagle has a Tail1 Beagle has a Jumper int foo more code here void foo more code here 1正確 public void foo more code here 1正確 private void foo more code here protected void foo more code here 1正確 Raccoon is a Mammal 1正確 Raccoon has a Mammal 1正確 BabyRaccoon is a Mammal 1正確 BabyRaccoon is a Raccoon public void foo public int foo return 3 public Two foo return this 1正確 public One foo return this 1正確 public Object foo return this super name baseSalary 1正確 mission commission 1 super mission commission 1 mission commission super 1 su
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 危房住戶搬離協(xié)議書
- 南京房屋出售協(xié)議書
- 北京資產(chǎn)管理協(xié)議書
- 零陵期中考試試卷及答案
- 分包物資管理協(xié)議書
- 合同單方解除協(xié)議書
- 臺球購買合同協(xié)議書
- 卸貨裝貨合同協(xié)議書
- 遼陽市九中考試卷子及答案
- 醫(yī)院殘疾處置協(xié)議書
- (完整版)產(chǎn)品質(zhì)量保證的措施
- 2023年資產(chǎn)負(fù)債表模板
- 高中化學(xué)實(shí)驗(yàn)操作考試試題
- 01SS105給排水常用儀表及特種閥門安裝圖集
- 管道燃?xì)饪头T(中級工)技能鑒定考試題庫大全(含答案)
- 【課件】Unit+3Reading+and+Thinking+課件人教版(2019)選擇性必修第四冊
- 某大學(xué)2021-2022年《2417客戶關(guān)系管理》期末考試真題及答案(共4套)
- 產(chǎn)品合格證標(biāo)準(zhǔn)模板
- 電力現(xiàn)貨市場基本原理課件
- 衛(wèi)浴建材購銷合同衛(wèi)浴潔具建材購銷合同
- 國際公路貨物運(yùn)輸合同公約cmr
評論
0/150
提交評論