• 2022-07-24 问题

    下面( )方法是public void example(){}的重载方法。 A: private String example(){} B: public int example(String str){} C: public void example2(){} D: public int example(int m,float f){}

    下面( )方法是public void example(){}的重载方法。 A: private String example(){} B: public int example(String str){} C: public void example2(){} D: public int example(int m,float f){}

  • 2022-06-07 问题

    public class Example { String str = new String("Java"); StringBuffer sb = new StringBuffer("C#"); public void strcat(String str, StringBuffer sb) { str = str + " study"; sb = sb.append(" exam"); } public static void main(String args[]) { Example ex = new Example(); ex.strcat(ex.str, ex.sb); System.out.println(ex.str); System.out.println(ex.sb); }}程序的输出结果是:______

    public class Example { String str = new String("Java"); StringBuffer sb = new StringBuffer("C#"); public void strcat(String str, StringBuffer sb) { str = str + " study"; sb = sb.append(" exam"); } public static void main(String args[]) { Example ex = new Example(); ex.strcat(ex.str, ex.sb); System.out.println(ex.str); System.out.println(ex.sb); }}程序的输出结果是:______

  • 2021-04-14 问题

    阅读程序,下面的哪个选项是正确的?( )。 class ExSuper{ String name; String nick_name; public ExSuper(String s,String t) { name = s; nick_name = t; } public String toString(){ return name; } } public class Example extends ExSuper{ public Example(String s,String t){ super(s,t); } public String toString(){ return name +"a.k.a"+nick_name; } public static void main(String args[]){ ExSuper a = new ExSuper(“First”,“1st”); ExSuper b = new Example(“Second”,“2nd”); System.out.println(“a is”+a.toString()); System.out.println("b is"+b.toString()); } }

    阅读程序,下面的哪个选项是正确的?( )。 class ExSuper{ String name; String nick_name; public ExSuper(String s,String t) { name = s; nick_name = t; } public String toString(){ return name; } } public class Example extends ExSuper{ public Example(String s,String t){ super(s,t); } public String toString(){ return name +"a.k.a"+nick_name; } public static void main(String args[]){ ExSuper a = new ExSuper(“First”,“1st”); ExSuper b = new Example(“Second”,“2nd”); System.out.println(“a is”+a.toString()); System.out.println("b is"+b.toString()); } }

  • 2022-05-27 问题

    程序运行的结果是: good and gbc。( ) public class Example{ String str=new String(“good”); char[]ch={‘a’,'b’,'c’}; public static void main(String args[]){ Example ex=new Example(); ex.change(ex.str,ex.ch); System.out.print(ex.str+” and “); Sytem.out.print(ex.ch); } public void change(String str,char ch[]){ str=”test ok”; ch[0]=’g'; } }

    程序运行的结果是: good and gbc。( ) public class Example{ String str=new String(“good”); char[]ch={‘a’,'b’,'c’}; public static void main(String args[]){ Example ex=new Example(); ex.change(ex.str,ex.ch); System.out.print(ex.str+” and “); Sytem.out.print(ex.ch); } public void change(String str,char ch[]){ str=”test ok”; ch[0]=’g'; } }

  • 2022-05-27 问题

    对于下列代码: public class Example{ String str=new String("java"); char ch[]={'d','b','c'}; public static void main(String args[]){ Example ex=new Example(); ex.change(ex.str,ex.ch); System.out.println(ex.str+" and "+ex.ch[0]); } public void change(String str,char ch[]){ str="world";ch[0]= 'b'; } } 输出结果是: ( ) A: javaandd B: javaand C: javaandc D: javaanda

    对于下列代码: public class Example{ String str=new String("java"); char ch[]={'d','b','c'}; public static void main(String args[]){ Example ex=new Example(); ex.change(ex.str,ex.ch); System.out.println(ex.str+" and "+ex.ch[0]); } public void change(String str,char ch[]){ str="world";ch[0]= 'b'; } } 输出结果是: ( ) A: javaandd B: javaand C: javaandc D: javaanda

  • 2021-04-14 问题

    阅读下列程序public class Example public static void main(String[]

    阅读下列程序public class Example public static void main(String[]

  • 2022-05-29 问题

    “for” statement in Python can be used to iterate on any sequence, for example, list, string and tuple.

    “for” statement in Python can be used to iterate on any sequence, for example, list, string and tuple.

  • 2022-05-27 问题

    下列程序运行的结果是______。   public class Example{   String str=new String("good");   char[]ch={’a’,’b’,’c’};   public static void main(String args[]){   Example ex=new Example();   ex.change(ex.str,ex.ch);   System.out.print(ex.str+" and ");   System.out.print(ex.ch);   }   public void change(String str,char ch[]){   str="test ok";   ch[0]=’g’;   } A: good and abc B: good and gbc C: test ok and abc D: test ok and gbc

    下列程序运行的结果是______。   public class Example{   String str=new String("good");   char[]ch={’a’,’b’,’c’};   public static void main(String args[]){   Example ex=new Example();   ex.change(ex.str,ex.ch);   System.out.print(ex.str+" and ");   System.out.print(ex.ch);   }   public void change(String str,char ch[]){   str="test ok";   ch[0]=’g’;   } A: good and abc B: good and gbc C: test ok and abc D: test ok and gbc

  • 2022-05-31 问题

    给出以下代码,请问插入以下哪些语句可以使程序编译通过?( )class Base{public Base(int i){}}public class Example extend Base{public static void main (String arg[]){Example e = new Example(10);}Example(int i){Super(i);}Exanple(String s, int i){this(i);//插入代码处}}请选择一个正确答案: A: Example d = new Example(); B: Super(); C: This(“Hello”,10); D: Base b = ne Base(10);

    给出以下代码,请问插入以下哪些语句可以使程序编译通过?( )class Base{public Base(int i){}}public class Example extend Base{public static void main (String arg[]){Example e = new Example(10);}Example(int i){Super(i);}Exanple(String s, int i){this(i);//插入代码处}}请选择一个正确答案: A: Example d = new Example(); B: Super(); C: This(“Hello”,10); D: Base b = ne Base(10);

  • 2022-05-29 问题

    “for” statement in Python can be used to iterate on any sequence, for example, list, string and tuple. A: 正确 B: 错误

    “for” statement in Python can be used to iterate on any sequence, for example, list, string and tuple. A: 正确 B: 错误

  • 1 2 3 4 5 6 7 8 9 10