多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

import java.awt.*;   public class Test extends Frame {   public Test() {   add(new Label(“Hello”) );   add(new TextField(“Hello”) );   add(new Button(“Hello”) );   pack();   show();    }   public static void main(String args) {   new Test ();   }   }   What is the result? () 

  • A、 The code will not compile.
  • B、 A Window will appear containing only a Button.
  • C、 An IllegalArgumentException is thrown at line 6.
  • D、 A Window button will appear but will not contain the Label, TextField, or Button.
  • E、 A Window will appear containing a Label at the top, a TextField below the Label, and a Button  below the TextField.
  • F、 A Window will appear containing a Label on the left, a TextField to the right of the Label, and a button to the right of the TextField.
正确答案:B
答案解析:
进入题库查看解析

微信扫一扫手机做题