请在 下方输入 要搜索的题目:

对于下列代码:

class DataServer extends Server {

public String serverName;

public DataServer() { serverName = "Customer Service"; super(serverName);

}

}

以下哪句描述是对的?


选项:

A:

代码可以通过编译


B:

代码可以通过编译,但在创建 DataServer 对象的时候,会产生错误


C:

代码不能通过编译因为第 5 行出错


D:

代码不能通过编译因为第 3 行出错

发布时间:2024-04-22 18:07:58
推荐参考答案 ( 由 搜题小帮手 官方老师解答 )
联系客服
答案:

以下文字与答案无关

提示:有些试题内容 显示不完整,文字错误 或者 答案显示错误等问题,这是由于我们在扫描录入过程中 机器识别错误导致,人工逐条矫正总有遗漏,所以恳请 广大网友理解。

相关试题
] B、[SPAN ] C、[

P

] D、[
DIV
, SPAN,

P

] ">14.HTML 代码:
DIV
SPAN

P

jQuery 代码: $("*") 结果:( ) 选项:A、[
DIV
] B、[SPAN ] C、[

P

] D、[
DIV
, SPAN,

P

]
  • 第十行 f=f+step ;

    第十一行 }

    第十二行 return 0;

    第十三行}

    第8行代码: c = 5.0 / 9 * (f - 32)

    第10行代码: f = f - step

    第8行代码: c = 5.0 / (9 * (f - 32))

    第10行代码: f = f + step

    第8行代码: c = 5 / 9 * (f - 32)

    第10行代码: c = c + step

    第8行代码: c = 5.0 / 9 * (f - 32)

    第10行代码: f = f + step

    选项: A:

    第8行代码: c = 5.0 / 9 * (f - 32)

    第10行代码: f = f - step

    B:

    第8行代码: c = 5.0 / (9 * (f - 32))

    第10行代码: f = f + step

    C:

    第8行代码: c = 5 / 9 * (f - 32)

    第10行代码: c = c + step

    D:

    第8行代码: c = 5.0 / 9 * (f - 32)

    第10行代码: f = f + step

    ">15.华氏和摄氏温度的转换公式为C=5/9×(F-32)。式中,C表示摄氏温度,F表示华氏温度。要求:华氏0℉~300℉,每隔20℉输出一个华氏温度对应的摄氏温度值。按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。

    :#include

    第行int main()

    第行{

    第四行 int upper = 300, step = 20;

    第行 float f = 0, c;

    第六行 while (f < upper)

    第七行 {

    第八行 c=5.0/9*(f-32);

    第九行 printf("%4.0f\t%6.1f\n", f ,c);

    第十行 f=f+step ;

    第十一行 }

    第十二行 return 0;

    第十三行}

    第8行代码: c = 5.0 / 9 * (f - 32)

    第10行代码: f = f - step

    第8行代码: c = 5.0 / (9 * (f - 32))

    第10行代码: f = f + step

    第8行代码: c = 5 / 9 * (f - 32)

    第10行代码: c = c + step

    第8行代码: c = 5.0 / 9 * (f - 32)

    第10行代码: f = f + step

    选项: A:

    第8行代码: c = 5.0 / 9 * (f - 32)

    第10行代码: f = f - step

    B:

    第8行代码: c = 5.0 / (9 * (f - 32))

    第10行代码: f = f + step

    C:

    第8行代码: c = 5 / 9 * (f - 32)

    第10行代码: c = c + step

    D:

    第8行代码: c = 5.0 / 9 * (f - 32)

    第10行代码: f = f + step

  • DIV
  • ] B:[SPAN ] C:[

    P

    ] D:[
    DIV
    , SPAN,

    P

    ]">16.HTML 代码:
    DIV
    SPAN

    P

    jQuery 代码: $("*") 结果:( ) 选项: A:[
    DIV
    ] B:[SPAN ] C:[

    P

    ] D:[
    DIV
    , SPAN,

    P

    ]
  • 17.编译java源代码文件的工具为(  )。 选项: A:

    javac

    B:

    java

    C:

    javadoc

    D:

    jdk

  • 18.HTML 代码:[br][/br]div[br][/br][p]p[/p][p][span]span[/][br][/br][/p][p]p[/p][p]jQuery 代码: $("div,span,p.myClass") 结果:( )[/p] 选项: A、[ div, p, span ] B、 C、 D、[div]
  •       byte ] a="abcd".getBytes();

          try{ FileOutputStream out=new FileOutputStream(f);

              out.write(a);

              out.close(); 

              FileInputStream in=new FileInputStream(f);

              byte ] tom= new byte3];

              int m = in.read(tom,0,3);

              System.out.println(m);       //【代码1】

              String s=new String(tom,0,3);

              System.out.println(s);        //【代码2】

              m = in.read(tom,0,3);

              System.out.println(m);       //【代码3】

              s=new String(tom,0,3);

              System.out.println(s);        //【代码4】

          }

          catch(IOException e) {}

       }

    }

    ">19.上机调试题:请说出E类中标注的【代码1】~【代码4】的输出结果。

     

    import java.io.*;

    public class E {

       public static void main(String args]) {

          int n=-1;

          File f =new File("hello.txt");

          byte ] a="abcd".getBytes();

          try{ FileOutputStream out=new FileOutputStream(f);

              out.write(a);

              out.close(); 

              FileInputStream in=new FileInputStream(f);

              byte ] tom= new byte3];

              int m = in.read(tom,0,3);

              System.out.println(m);       //【代码1】

              String s=new String(tom,0,3);

              System.out.println(s);        //【代码2】

              m = in.read(tom,0,3);

              System.out.println(m);       //【代码3】

              s=new String(tom,0,3);

              System.out.println(s);        //【代码4】

          }

          catch(IOException e) {}

       }

    }

  • 20.Java源代码经过编译后会生成字节码文件,字节码文件的扩展名是()。 选项: A:

    java

    B:

    class

    C:

    html

    D:

    exe

  • 21.请说出E类中标注的【代码1】~【代码4】的输出结果____。(多个结果之间用#号隔开)。

    import java.io.*;

    public class E {

    public static void main(String args]) {

    int n=-1;

    File f =new File("hello.txt");

    byte ] a="abcd".getBytes();

    try{ FileOutputStream out=new FileOutputStream(f);

    out.write(a);

    out.close();

    FileInputStream in=new FileInputStream(f);

    byte ] tom= new byte3];

    int m = in.read(tom,0,3);

    System.out.println(m); //【代码1】

    String s=new String(tom,0,3);

    System.out.println(s); //【代码2】

    m = in.read(tom,0,3);

    System.out.println(m); //【代码3】

    s=new String(tom,0,3);

    System.out.println(s); //【代码4】

    }

    catch(IOException e) {}

    }

    }(2.0分)

  • 22.分析下面的代码,输出结果正确的是( )

    Double d=84.54;

    D++;

    Int c=d/2;

    选项: A:

    42

    B:

    编译错误,更改为int c=(int)d/2;

    C:

    43

    D:

    编译错误,更改为int c=int(d)/2;

  • 23.分析下面的代码,输出结构正确的是( ).

    double d=84.54;

    d++;

    Int c=d/2;

    选项: A:

    42

    B:

    编译错误,更改为int c=(int)d/2

    C:

    43

    D:

    编译错误,更改为int c=int(d)/2

  • 24.分析下面的代码,输出结果正确的是( )。(选一项)

    double d = 84.54;

    d++;

    int c = d/2;

    选项: A:

    42

    B:

    编译错误,更改为intc=(int)d/2;

    C:

    43

    D:

    编译错误,更改为intc=int/2;

  • 没有账号?点我注册
    热门标签
    登录 - 搜题小帮手
    点我刷新
    立即注册
    注册 - 搜题小帮手
    点我刷新
    立即登录