下面的程序段执行后,输出的结果是以下哪个选项? StringBuffer buf=new StringBuffer("wuhan2020"); buf.insert(5, "@"); System.out.println(buf.toString());
举一反三
- 下面哪个结果是正确的?() public class Testjava { public static void main(String [] args ){ StringBuffer buf=new StringBuffer("mycode666"); buf.insert(5,"@"); System.out.println(buf.toString()); } }
- 下面程序段的输出结果是。 StringBuffer buf1=new StringBuffer(20); System.out.println(buf1.length()+" , "+buf1.capacity());
- 下面的程序段执行后,输出的结果是以下哪个选项?StringBufferbuf=newStringBuffer("Beijing2008");buf.insert(7,"@");System.out.println(buf.toString()); A: Beijing@2008 B: @Beijing2008 C: Beijing2008@ D: Beijing E: 2008
- 下列代码段执行后的结果是 StringBuffer s=new StringBuffer("Hello"); if((s.length()>=5)&&(s.append("there").equals("False"))) s.replace(0,6,"False"); System.out.println(s);
- 若有如下类,则执行语句 A *a=new B(10); delete a;输出结果为()。 class A{ public: virtual ~A{ cout< }; class B:public A{ char *buf; public: B(int i) { buf=new char[i]; } virtual ~B{ delete []buf; cout< } };