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

题目内容 (请给出正确答案)
以下语句能顺利通过编译: class test { static void sayHello() { this.toString(); } public String toString() { retur。()

此题为判断题(对,错)。


参考答案

更多 “ 以下语句能顺利通过编译: class test { static void sayHello() { this.toString(); } public String toString() { retur。() 此题为判断题(对,错)。 ” 相关考题
考题 下列语句输出结果为( )。public class test{public static void main(String args[]){byte b=OXA;System.out.println(b);}}A.OXAB.AC.1D.10

考题 阅读下面程序class Test implements Runnable{public static void main(String[] args){Test t = new Test();t.start();}public void run(){ }}下列关于上述程序的叙述正确的是A) 程序不能通过编译,因为 start() 方法在 Test 类中没有定义B) 程序编译通过,但运行时出错,提示 start() 方法没有定义C) 程序不能通过编译,因为 run() 方法没有定义方法体D) 程序编译通过,且运行正常

考题 下列代码的执行结果是public class Test{ public int aMethod(){ static int i=0; i++; System.out.println(i); } public static void main(String args[]){ Test test= new Test(); test. aMethod(); }}A.编译错误B.0C.1D.运行成功,但不输出

考题 下列语句输出的结果为( )。 public class test { public static void main(String args[]) { byte b=OXA; System.out.println(b); } }A.OXAB.AC.1D.10

考题 以下代码的输出结果?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 Test {int m=5;public void some(int x) {m=x;}public static void main(String args []) {new Demo().some(7);}}class Demo extends Test {int m=8;public void some(int x) {super.some(x);System.out.println(m);}}A.5B.8C.7D.无任何输出E.编译错误

考题 以下程序能顺利通过编译: public class am_I_right { public static void main(String args[]) { this.toString(); } String toString() { retur。() 此题为判断题(对,错)。

考题 以下语句能顺利通过编译: abstract class class1 { } public class mainClass { public static void main(String args[]) { class1 cs1=new class1(); } } 。() 此题为判断题(对,错)。

考题 以下语句能顺利通过编译: final class class1 { } class class2 extends class1 { } 。() 此题为判断题(对,错)。

考题 以下语句可以通过编译: class am_I_abstract { abstract void method1(); } 。() 此题为判断题(对,错)。

考题 以下语句可以通过编译: abstract class am_I_abstract { abstract void method1(); }。() 此题为判断题(对,错)。

考题 以下语句能顺利通过编译: class class1 { private int i=5; //i为私有属性!! } public class class2 { public static void main(String args[]) { class1 cs1=new class1(); System.out.println(cs1.i); } } 。() 此题为判断题(对,错)。

考题 以下语句能顺利通过编译: class class1 { private final void method1() {} }。() 此题为判断题(对,错)。

考题 以下程序能顺利通过编译: class student { String sno,sname; static void output() { this.toString(); } String toString() { retur。() 此题为判断题(对,错)。

考题 设有程序如下: abstract class absclass { abstract void method1(); } class conclass extends absclass { public void method1() { System.out.println("子类");} } public class mainclass { public static void main(String args[]) { absclass ac1=new absclass(); //语句1 absclass ac2=new conclass(); //语句2 ac2.method1(); //语句3 } } 则main()方法中的第一条语句(即语句1)可以顺利通过编译。()此题为判断题(对,错)。

考题 以下语句能顺利通过编译: class class1 { private final method1() {} } 。() 此题为判断题(对,错)。

考题 { public static void main(String args[]) { System.out.println(MyClass1.data); } } class MyClass1 { int data=10; } 。() 此题为判断题(对,错)。

考题 执行以下代码会输出什么结果?()   public class Test {    StringgetStr(String s){  return s + “hello”;  }  public static void main(String arg[]) {           Test t= new Test();  System.out.println(t.getStr(“LiLei/n”));     } } A、 编译报错B、 LiLei    helloC、 LiLeihelloD、 无任何输出

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

考题 class A {   public String toString () {   return “4”;   }   }   class B extends A {   8. public String toString () {   return super.toString() + “3”;   }   }   public class Test {   public static void main(Stringargs) {   System.out.printIn(new B());   }   }   What is the result?()  A、 Compilation succeeds and 4 is printed.B、 Compilation succeeds and 43 is printed.C、 An error on line 9 causes compilation to fail.D、 An error on line 14 causes compilation to fail.E、 Compilation succeeds but an exception is thrown at line 9.

考题 Public class test (  Public static void main (String args[])  (  System.out.printIn (6 ^ 3);  )  )   What is the output?()

考题 编译如下Java程序片断:  class test{  int count = 9;  public void a(){    int count=10;  System.out.println("count 1 =" + count);  }  public void count(){  System.out.println("count 2 =" + count);  }  public static void main(String args[]){    test t=new test();    t.a();   t.count();   } }  结果将()。    A、不能通过编译B、输出: count 1 = 10 count 2 = 9C、输出:count 1 = 9 count 2 = 9

考题 Public class test (  Public static void stringReplace (String text)  (  Text = text.replace (‘j’ , ‘i’);  )  public static void bufferReplace (StringBuffer text)  (  text = text.append (“C”)  )   public static void main (String args[]}  (  String textString = new String (“java”); StringBuffer text BufferString = new StringBuffer (“java”);  stringReplace (textString);  bufferReplace (textBuffer);  System.out.printLn (textString + textBuffer);  ) )  What is the output?()

考题 单选题下列程序的运行结果是(  )。class Test extends Thread{public static void main(String[] args){Thread t=new Thread();t.start();}public void run(){System.out.println("Hello");}}A 程序不能通过编译,因为没有import语句将Thread类引入B 程序不能通过编译,因为Test类没有实现Runnable接口C 程序通过编译,且运行正常,没有任何输出D 程序通过编译,且运行正常,打印出一个"Hello"

考题 单选题执行以下代码会输出什么结果?()   public class Test {    StringgetStr(String s){  return s + “hello”;  }  public static void main(String arg[]) {           Test t= new Test();  System.out.println(t.getStr(“LiLei/n”));     } }A  编译报错B  LiLei    helloC  LiLeihelloD  无任何输出

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

考题 单选题class A {   public String toString () {   return “4”;   }   }   class B extends A {   8. public String toString () {   return super.toString() + “3”;   }   }   public class Test {   public static void main(Stringargs) {   System.out.printIn(new B());   }   }   What is the result?()A  Compilation succeeds and 4 is printed.B  Compilation succeeds and 43 is printed.C  An error on line 9 causes compilation to fail.D  An error on line 14 causes compilation to fail.E  Compilation succeeds but an exception is thrown at line 9.