itgle.com

importjava.awt.*;publicclassXextendsFrame{publicstaticvoidmain(Stringargs){Xx=newX();x.pack();x.setVisible(true);}publicX(){setLayout(newBordrLayout());Panelp=newPanel();add(p,BorderLayout.NORTH);Buttonb=newButton(North”);p.add(b):Buttonb=newButton(South”

题目

importjava.awt.*;publicclassXextendsFrame{publicstaticvoidmain(Stringargs){Xx=newX();x.pack();x.setVisible(true);}publicX(){setLayout(newBordrLayout());Panelp=newPanel();add(p,BorderLayout.NORTH);Buttonb=newButton(North”);p.add(b):Buttonb=newButton(South”);add(b1,BorderLayout.SOUTH):}}Whichtwostatementsaretrue?()

A.Thebuttonslabeled“North”and“South”willhavethesamewidth.

B.Thebuttonslabeled“North”and“South”willhavethesameheight.

C.Theheightofthebuttonlabeled“North”canveryiftheFrameisresized.

D.Theheightofthebuttonlabeled“South”canveryiftheFrameisresized.

E.Thewidthofthebuttonlabeled“North”isconstanteveniftheFrameisresized.

F.Thewidthofthebuttonlabeled“South”isconstanteveniftheFrameisresized.


相似考题
参考答案和解析
参考答案:B, E
更多“importjava.awt.*;publicclassXextendsFrame{publicstaticvoidmain(Stringargs){Xx=newX();x.pac ”相关问题
  • 第1题:

    以下哪个是Java应用程序main方法的有效定义?

    A. public static void main();

    B. public static void main( String args );

    C. public static void main( String args[] );

    D. public static void main( Graphics g );

    E. public static boolean main( String a[] );


    正确答案:C

  • 第2题:

    下面那个是java应用程序主类中正确的main方法?

    A.public void main(String args[])

    B.static void main(String args[])

    C.public static void Main(String args[])

    D.public static void main(String args[])


    public static void main(String args[ ])

  • 第3题:

    设x,y均为已定义的类名,下列声明对象x1的语句不可能正确的是

    A.public x x1=new y();

    B.x x1=x();

    C.x x1=new x();

    D.public y x1=new x();


    X x1=new X();

  • 第4题:

    下面哪个是Java应用程序主类中正确的main方法?

    A.public void main(String args[])

    B.static void main(String args[])

    C.public static void main(String args[])

    D.public static void Main(String args[])


    D

  • 第5题:

    下列哪个是Java应用程序主类中正确的main方法?

    A.public void main (String args[ ])

    B.static void main (String args[ ])

    C.public static void Main (String args[])

    D.public static void main (String args[ ])


    D