black

SCJP程序员认证考试

登录

多项选择题

Given the following code, which code fragments, when inserted at the indicated location, will succeed in making the program display a button spanning the whole window area?()  
import java.awt.*; 
 public class Q1e65 {  
public static void main(String args[]) {  
Window win = new Frame();  
Button but = new Button("button");  
// insert code fragment here  win.setSize(200, 200); 
 win.setVisible(true); 
 }  
}  

A.win.setLayout(new BorderLayout()); win.add(but);
B.win.setLayout(new GridLayout(1, 1)); win.add(but);
C.win.setLayout(new BorderLayout()); win.add(but, BorderLayout.CENTER);
D.win.add(but);
E.win.setLayout(new FlowLayout()); win.add(but);

相关考题

单项选择题 Whichstatementsconcerningtheeffectofthestatementgfx.drawRect(5,5,10,10)aretrue,giventhatgfxisareferencetoavalidGraphicsobject?()

单项选择题 What will be written to the standard output when the following program is run?()   public class Qcb90 {   int a;   int b;   public void f() {  a = 0;   b = 0;   int[] c = { 0 };   g(b, c);   System.out.println(a + " " + b + " " + c[0] + " ");   }   public void g(int b, int[] c) {   a = 1;  b = 1;  c[0] = 1;  }   public static void main(String args[]) {   Qcb90 obj = new Qcb90();   obj.f();   }   }

单项选择题 What will be written to the standard output when the following program is run?()   public class Q8499 {   public static void main(String args[]) {  double d = -2.9;   int i = (int) d;  i *= (int) Math.ceil(d);  i *= (int) Math.abs(d);   System.out.println(i);   }   }

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3