网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

编译和运行以下代码结果为:

1. public class EqualsTest{

2. public static void main(String args[]){

3. byte A=(byte)4096;

4. if(A== 4096、System.out.println("Equal");

5. else System.out.println("Not Equal");

6. }

7. }

A.在第3行出现转换丢失精度的编译错误.

B.输出 "Not Equal".

C.输出 "Equal".


参考答案

更多 “ 编译和运行以下代码结果为:1. public class EqualsTest{2. public static void main(String args[]){3. byte A=(byte)4096;4. if(A== 4096、System.out.println("Equal");5. else System.out.println("Not Equal");6. }7. }A.在第3行出现转换丢失精度的编译错误.B.输出 "Not Equal".C.输出 "Equal". ” 相关考题
考题 下列代码的运行结果是( )。 public class Test { public static void main(String args[]) { System.out.println(89>>1); } }A.44B.45C.88D.90

考题 阅读下列代码 public class Test{ public static void main(String args[]){ System.out.println(89>>1); } } 其运行结果是A.44B.45C.88D.90

考题 阅读下列代码 public class Test{ String s="One World One Dream"; public static void main(String args[]){ System. out. println(s); } } 其运行结果是A.argsB.One World One DreamC.sD.编译时出错

考题 阅读下列代码Public class Person{Static int arr[ ] = new int (10);Public static void main (String args ) {System.out.println(arr[9]);}}该代码运行的结果是A )编译时将产生错误B )编译时正确,运行时将产生错误C )输出 0D )输出空

考题 如下两个源程序文件,分别编译后,运行Example.class文件,运行结果为______。AB.java文件代码如下;package test;public class AB{int a=60;public void show(){System.out.println(”a=”+a);}Example.java文件代码如下:import test.AB;class Example{public static void main(String args[]){AB bj=new AB();obj.show();}}

考题 阅读下面代码 public class Test { String s="One World One Dream"; public static void main(String[] args) { System.out.println(s); } } 其运行的结果是A.argsB.World One DreamC.sD.编译时出错

考题 阅读下面代码 public class Person { static int arr[]=new int[10]; public static void main(String args) { System.out.println(arr[9]); } } 该代码的运行结果是A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出零D.输出空

考题 阅读下面程序 public class My Val{ public static void main(String args[]){ My Val m=new My Val(); m. amethod(); } public void amethod(){ boolean b[]=new Boolean[5]; } } 程序编译或运行结果是A.1B.nullC.D.编译不能过

考题 运行下列程序的结果是 ( ) abstract class MineBase { abstract void amethod(); static int i; } public class Mine extends MineBase { public static void main(String argv[]){ int[]ar=new int[5]; for(i=0;i<ar.length;i++) System.out.println(ar[i]);A.打印5个0B.编译出错,数组ar[]必须初始化C.编译出错,Mine应声明为abstractD.出现IndexOutOfBoundes的例外

考题 下列代码的编译或执行结果是( )。 public class Myval{ public static void main(string args[]){ MyVal m=new MyVal; aMethod; } public void aMethod{ boolean b[]=new Boolean[5]; System.OUt.println(b[0]); } }A.1B.nullC.0D.编译错误

考题 编译和运行以下代码的结果为:public class MyMain{public static void main(String argv){System.out.println("Hello cruel world");}} A.编译错误;B.运行输出 "Hello cruel world";C.编译无错,但运行时指示没有定义构造方法。D.编译无错,但运行时指示没有正确定义main方法。

考题 编译和运行以下程序结果为:public class A {static int k=3;static int m;public static void main(String[] args) {k++;if (m==0)System.out.println(k);elseSystem.out.println(B.k);k++;}}class B {static int k=6;} A. 3B. 4C.5D.编译错误E.6

考题 以下代码的输出结果?public class Test{public static void main(String argv[]){String x="hello";change(x);System.out.println(x);}static void change(String m){m=m+2;}} A. helloB. hello2C. 编译报错D. 运行报错,不能将串与整数相加

考题 以下的程序的调试结果为?public class MyAr{public static void main(String argv[]) {MyAr m = new MyAr();m.amethod();}public void amethod(){static int i;System.out.println(i);}} A. 输出结果为 0B. 运行出错C. 输出结果为 nullD. 编译错误

考题 以下程序的编译和运行结果为?abstract class Base{abstract public void myfunc();public void another(){System.out.println("Another method");}}public class Abs extends Base{public static void main(String argv[]){Abs a = new Abs();A.amethod();}public void myfunc(){System.out.println("My Func");}public void amethod(){myfunc();}}A.输出结果为 My FuncB.编译指示 Base 类中无抽象方法C.编译通过,但运行时指示Base 类中无抽象方法D.编译指示Base 类中的myfunc方法无方法体,没谁会喜欢该方法。

考题 以下的程序的调试结果为public class Scope{int i;public static void main(String argv[]){Scope s = new Scope();s.amethod();}public static void amethod(){System.out.println(i);}} A. 输出结果为:0B. 无输出C. 编译错误D. 输出null

考题 分析下列代码:  Class A{  Public static void main(String[] args){  method(); }  static void method(){  try{  System.out.println("Hello"); }finally{  System.out.println("good-bye"); } } }  编译运行后,输出结果是()。 A、"Hello"B、"good-bye"C、"Hello""god-bye"D、代码不能编译

考题 执行以下代码,输出结果的结果是? () public class Test{  public String[] ss = new String[5];    public static void main(String[] args){      System.out.println(ss[1]);  } } A、 nullB、 -1C、 编译时出错D、 运行时报错

考题 阅读以下代码:  public class Test{  public static void main(){  System.out.println(“x=”+x);   } }  请问,代码运行的结果是?() A、 xB、 x=xC、 “x=”+5D、 编译报错

考题 执行以下代码后,下面哪些描述是正确的() public  class  Student{  private String name = “Jema”;  public void setName(String name){  this.name = name;  }  public String getName(){  return this.name;  }  public static void main(String[] args){  Student s;  System.out.println(s.getName()); } }A、输出nullB、第10行编译报错C、第11行编译报错D、输出Jema

考题 Which declarations will allow a class to be started as a standalone program?()  A、public void main(String args[])B、public void static main(String args[])C、public static main(String[] argv)D、final public static void main(String [] array)E、public static void main(String args[])

考题 分析下列java代码  Class A{  Public static void main(String[] args){  Method(); }  Static void method(){ try{  System.out.println(“hello”) }finally{  System.out.println(“good-bye”); }  } }  编译运行后,输出结果是()A、“hello”B、“good-bye”C、“hello”“good-bye”D、代码不能编译

考题 现有:      class TestA  {  public void start()  {  System.out.println("TestA");  }     }  public class TestB extends TestA  {  public void start()  {  System.out.println("TestB");  }     public static void main (string[]  args)  (     ((TestA)new TestB()).start();     )     }  运行结果是哪项?()     A、  TeStAB、  TeStBC、编译失败D、运行时抛出异常

考题 单选题分析下列代码:  Class A{  Public static void main(String[] args){  method(); }  static void method(){  try{  System.out.println("Hello"); }finally{  System.out.println("good-bye"); } } }  编译运行后,输出结果是()。A HelloB good-byeC Hellogod-byeD 代码不能编译

考题 单选题阅读以下代码:  public class Test{  public static void main(){  System.out.println(“x=”+x);   } }  请问,代码运行的结果是?()A  xB  x=xC  “x=”+5D  编译报错

考题 单选题现有:      class TestA  {  public void start()  {  System.out.println("TestA");  }     }  public class TestB extends TestA  {  public void start()  {  System.out.println("TestB");  }     public static void main (string[]  args)  (     ((TestA)new TestB()).start();     )     }  运行结果是哪项?()A   TeStAB   TeStBC 编译失败D 运行时抛出异常

考题 单选题执行以下代码,输出结果的结果是? () public class Test{  public String[] ss = new String[5];    public static void main(String[] args){      System.out.println(ss[1]);  } }A  nullB  -1C  编译时出错D  运行时报错