itgle.com

publicclassWow{publicstaticvoidgo(shortn){System.out.println(”short”);}publicstaticvoidgo(Shortn){System.out.println(”SHORT”);}publicstaticvoidgo(Longn){System.out.println(”LONG”);}publicstaticvoidmain(String[]args){Shorty=6;intz=7;go(y);go(z);}}Whatisthe

题目

publicclassWow{publicstaticvoidgo(shortn){System.out.println(”short”);}publicstaticvoidgo(Shortn){System.out.println(”SHORT”);}publicstaticvoidgo(Longn){System.out.println(”LONG”);}publicstaticvoidmain(String[]args){Shorty=6;intz=7;go(y);go(z);}}Whatistheresult?()

A.shortLONG

B.SHORTLONG

C.Compilationfails.

D.Anexceptionisthrownatruntime.


相似考题
参考答案和解析
参考答案:C
更多“publicclassWow{publicstaticvoidgo(shortn){System.out.println(”short”);}publicstaticvoidgo( ”相关问题
  • 第1题:

    自动类型转换规定的优先次序是( )。

    A.short,byte,char→long→int→float→double

    B.short,byte,char→int→long―float→double

    C.byte,short,char→long→int→float→double

    D.byte,short,char→int→long→float→double


    正确答案:D

  • 第2题:

    以下代码中变量result的可能类型有哪些?byte b = 11;short s = 13;result = b * ++s;

    A.byte, short, int, long, float, double

    B.boolean, byte, short, char, int, long, float, double

    C.byte, short, char, int, long, float, double

    D.byte, short, char

    E.int, long, float, double


    正确答案:E
     

  • 第3题:

    【单选题】Java语言中数值数据的类型能自动转换,按照从左到右的转换次序为

    A.byte→int→short→long→float→double

    B.byte→short→int→long→float→double

    C.byte→short→int→float→long→double

    D.short→byte→int→long→float→double


    boolean类型数据只有2个值,true和false

  • 第4题:

    自动类型转换是按优先关系从低级数据转换成高级数据,规定的优先次序是( )。

    A.byte,short,char→int→long→float→double

    B.float→int→long→byte,short,char→double

    C.int→long→float→double←byte,short,char

    D.double→int→folat→long→byte,short,char


    正确答案:A

  • 第5题:

    10、Java语言中数值数据的类型能自动转换,按照从左到右的转换次序为 ()

    A.byte→int→short→long→float→double

    B.byte→short→int→long→float→double

    C.byte→short→int→float→long→double

    D.short→byte→int→long→float→double


    B