现有: class A {public String name="a"} class B extends A {public String name="b"} 执行如下代码后的结果是哪项?() A a=new B(); System.out.println(a.name); A、 aB、 bC、编译失败D、运行时抛出异常
现有: class A {public String name="a"} class B extends A {public String name="b"} 执行如下代码后的结果是哪项?() A a=new B(); System.out.println(a.name);
- A、 a
- B、 b
- C、编译失败
- D、运行时抛出异常
相关考题:
2下列程序实现对ZIP 文件file.zip 的检索,在横线处填入正确的语句是( )。package test;import java.io.*;import java.util.*; import java.util.zip.*;public class Exam{ public static void main(String[] args){ try{ FileInputStream fis = new FilelnputStream("test/file.zip"); ZipInputStream zis = new ZiplnputStream(fis); ZipEntry en; while ((______ )!= null){ en.getName(); zis.closeEntry(); } zis.close(); } catch(Exception e){ e.pfintStackTrace(); }}A.en = zis. getNextEntry()B.en == zis.getNextEntry(C.en=zis. getEntry()D.zis.getNextEntry()
有如下程序:includeusing namespace std;class test{private: int a;public: test( 有如下程序:#include<iostream>using namespace std;class test{private: int a;public: test(){cout<<"constructor"<<endl;} test(int a){cout<<a<<endl;} test(const test_test) { a=_test.a; cout<<"copy constructor"<<en+dl; } ~test(){cout<<"destructor"<<endl;}};int main(){ test A(3); rerun 0;}运行时输出的结果是A.3B.constructor destructorC.copy constructor destructorD.3 destructor
现有如下包结构:com|--x||--Alpha.class||||--y||--Beta.class||--Gamma.class和类:classTest{Alphaa;Betab;Gammac;}哪三个必须加入到类Test中,以使其通过编译?() A.packagey;B.packagecom;C.importcom.x.*;D.importcom.x.y.*
现有如F包结构:com|一一X||一一Alpha.class||||一一yI|一一Beta.class||l--Gamma.class和类:classTest{Alphaa;Betab;Gammac;}哪三个必须加入到类Test中,以使其通过编译?() A.packagey;B.packagecom;C.importcom.x.y.*;D.importcom.x.*;
现有两个类A,B,以下描述中表示B继承自A的是 ( )A.class A extends BB.class B implements AC.class A implements BD.class B extends A
质量衰减系数μ/ρ,质量能量转移系数μtr/ρ和质量能量吸收系数μen/ρ三者之间的关系是 A、μ/ρ>μtr/ρ=μen/ρB、μ/ρ>μtr/ρ>μen/ρC、μ/ρμen/ρE、以上都不对
下列程序实现对ZIP文件file.zip的检索,在横线处 填入正确的语句( )。 package test; importjava.io.*; import java.util.*; import java.util.zip.*; public class Exam { public static void main(String[]args){ try{ FileInputStream fis=new FileInputStream("test/file. zip"); ZipInputStream zis=new ZiplnputStream(fis); ZipEntry an; while(( )!=null){ en.getName; zis.closeEntry; } zis.close: } catch(Exception e){ printStackTrace; } } }A.en=zis.getNextEntryB.en= =zis.getNextEntryC.en=zis.getEntryD.zis.getNextEntry
下列程序实现对ZIP文件file.zip的检索,在横线处填入正确的语句 package test; import java.io.*: import java.util.*; import java.util.zip.*; public class Exam { public static void main(String[])args){ try{ FileInputStream fis=new FileInputStream("test/file.zip"); ZipInputStreamzis=new ZipInputStream(fis); ZipEntry en; while ((_____)!=null){ en.getName(); zis.closeEntry(); } zis.close(); } catch(Exception e) { e.printStackTrace(); } } }A.en = zis.getNextEntry()B.en = zis.getNextEntry()C.en = zis.getEntry()D.zis.getNextEntry()
现有包结构: com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class 和类: //insert code here import com.*; import com.x.y.*; class Test { Alpha a; Beta b; Gamma c; } 哪两行分别插入后可允许代码编译?() A、package com.;B、import com.x;C、package com.x;D、import com.x.Alpha;
现有如下包结构: com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class 和类: class Test { Alpha a; Beta b; Gamma c; } 哪三个必须加入到类 Test 中,以使其通过编译?()A、package y;B、package com;C、import com.x.*;D、import com.x.y.*
现有: class TestApp{ public static void main (String[] args){ for (int i=0; iA、0123B、012456789C、0123456789D、012
质量衰减系数μ/ρ,质量能量转移系数μtγ/ρ和质量能量吸收系数μen/ρ者之间的关系是()A、μ/ρμtγ/ρ=μen/ρB、μ/ρμtγ/ρμen/ρC、μ/ρ<μtγ/ρ<μen/ρD、μ/ρ=μtγ/ρμen/ρE、以上都不对
质量衰减系数μ/ρ,质量能量转移系数μtr/ρ和质量能量吸收系数μen/ρ三者之间的关系是()A、μ/ρμtr/ρ=μen/ρB、μ/ρμtr/ρμen/ρC、μ/ρμtr/ρμen/ρD、μ/ρ=μtr/ρμen/ρE、以上都不对
Which of the following functions does the "ifconfig en4 down" perform?()A、Removes the en4 interfaceB、Removes the en4’s network routeC、Stops all traffic through the en4 interfaceD、Stops all traffic through the en4 and removes its network route from the routing table
单选题En 1959, le gouvemement français a décidé que _____.Al’enseignement en France serait obligatoire de quatre à seize ansBl’enseignement en France serait obligatoire après six ansCl’enseignement en France serait obligatoire de six à seize ansDl’enseignement en France serait obligatoire de quatre à seize ans
单选题现有: 1. interface Animal { 2. void eat(); 3. } 4. 5. // insert code here 6. 7. public class HouseCat extends Feline { 8. public void eat() { } 9. } 和五个声明: abstract class Feline implements Animal { } abstract class Feline implements Animal { void eat(); } abstract class Feline implements Animal { public void eat(); } abstract class Feline implements Animal { public void eat() { } } abstract class Feline implements Animal { abstract public void eat(); } 分别插入到第5行,有几个可以通过编译?()A0B1C2D3
单选题En Bulgarie, les jeunes _____.Aaiment voyagerBsont doués en langueCveulent jouer au lotoDsont de moins en moins nombreux
多选题现有: public class TestDemo{ private int X-2; static int y=3; public void method(){ final int i=100; int j =10; class Cinner { public void mymethod(){ //Here } } } } 在Here处可以访问的变量是哪些?()AXByCjDi
单选题现有: interface Animal { void eat () ; } //insert code here public class HouseCat extends Feline { public void eat() { } } 和五个申明 abstract class Feline implements Animal { } abstract class Feline implements Animal { void eat () ; } abstract class Feline implements Animal { public void eat();} abstract class Feline implements Animal { public void eat() {} } abstract class Feline implements Animal { abstract public void eat();} 结果为:()A1B2C3D4
单选题Which of the following functions does the "ifconfig en0" perform?()AShuts down en0BDisplays en0 settingsCReconfigures en0 using the ODMDSends an SNMP alert to the network administrator
单选题现有: class TestApp{ public static void main (String[] args){ for (int i=0; iA0123B012456789C0123456789D012