[单选题]

在下面的程序段中,有关paint()方法中正确的说法是( )。 public void paint(Graphics g) { g.drawString("Any question", 10, 0); }

A.字符串Any question输出在左上角位置,坐标为(10,0)

B.只能看到一部分的字符

C.能全都看到

D.以上都不对

参考答案与解析:

相关试题

有下列程序段public class fun{public static voi

[单选题]有下列程序段 public class fun { public static void main(String args[]) { char b[] = "Hello,you"; b[5] = 0; System.out.println(s); } 执行此程序后,得到的输出结果是( )。A.Hello,youB.Hello0youC.HelloD.0

  • 查看答案
  • 阅读下面的程序段:public class Sun{public static

    [单选题]阅读下面的程序段: public class Sun { public static void main(String args[ ]) { int a=0 for(int i=1;i<=3;i++) { for(int j=1;j<-i;j++) { for(int k=j;k<=3;k++) { a=a+1; } } } System.out.println(A) 我; }}执行上面的3重循环后,a的值为( )。A.3B.9C.14D.21

  • 查看答案
  • 阅读下面的程序段: publiC class Sun { public stat

    [单选题]阅读下面的程序段: publiC class Sun { public static void main (String args[ ]) { int a=0; for(int i=1;i<=3;i++) { for(int j=1;j<=i;j++) { for(int k=j;k<=3;k++) { a=a+1; } } } System.out.println(A) ; } } 执行上面的3重循环后,a的值为( )。A.3B.9C.14D.21

  • 查看答案
  • 有如下程序:public class Sun{public static voi

    [单选题]有如下程序: public class Sun { public static void main(String args[ ]) { int s=0; int i=1; while(i<=100) { s=s+i; } System.out.println(s); } } 运行后的结果是( )。A.5050B.5051C.死循环,直到溢出D.无穷大的数

  • 查看答案
  • 有如下程序public class Sun{ public static voi

    [单选题]有如下程序 public class Sun { public static void main(String args[ ]) { int a=2,b=1,c=2; if(a<B) if(b<0) if(c<0) c=0; else C++; System.out.println(C) ; } } 上述程序的运行结果是( )。A.0B.1C.2D.3

  • 查看答案
  • 执行下面的程序段后,x的值为()。public class Sun{public

    [单选题]执行下面的程序段后,x的值为( )。 public class Sun { public static void main(String args[ ]) { int x=5; for(int i=l;i<=20;i=i+2) x=x+i/5; System.out.println(x); } }A.21B.22C.23D.24

  • 查看答案
  • 下面程序段中正确的是()。

    [单选题]下面程序段中正确的是()。A.If x<0 Then y=0 If x<1 Then y=1 If x=2 Then y=3B下面程序段中正确的是( )。A.If x<0 Then y=0 If x<1 Then y=1 If x<2 Then y=2 If x>=2 Then y=3B.If x>=2 Then y=3 If x>1 Then y=2 If x>=0Then y=1 If x>0 Then y=0C.If x<0 Then y=0 Else If>=0Then y=1 Else

  • 查看答案
  • 执行下面的程序段,输出结果为______。public class Q{publ

    [主观题]执行下面的程序段,输出结果为______。public class Q{public static void main(String argvr)){int anar[]=new int[5];System.out.println(anar[0]);}}

  • 查看答案
  • 下面的程序执行后,文件test.txt中的内容是() # include voi

    [单选题]下面的程序执行后,文件test.txt中的内容是() include void fun(char*

  • 查看答案
  • 有下面程序段: Public class ArrayTest{ Public s

    [判断题]有下面程序段: Public class ArrayTest { Public static void main(String args[]) { int[] intArray=new int[3]; for(int I=0;I<3;I++) { intArray[I]=I+2; System.out.println("IntArray["+I+"]"-"+intArray[I]); } System.out.println("------------"); Int arrLen=

  • 查看答案
  • 在下面的程序段中,有关paint()方法中正确的说法是()。public voi