网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

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.


参考答案

更多 “ 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. ” 相关考题
考题 public class X extends Frame{public static void main(String[] args){X x=new X();x.pack();x.setVisible(true);}public X(){setLayout(new GridLayout(2,2));Panel p1=new Panel(); add(p1);Button b1 A.all change height and widthB.Button One change heightC.Button Two change height and Button Three change widthD.Button Four change height and width

考题 下列哪些代码段是正确的?() A.X x=new X();Y y=new Y();Z z=new Z();y=(Y)x;B.X x=new X();Y y=new Y();Z z=new Z();x=(X)y;C.X x=new X();Y y=new Y();Z z=new Z();Z=(Z)x;D.X x=new X();Y y=new Y();Z z=new Z();W w=(W)x;

考题 importjava.awt.*;publicclassTestextendsFrame{publicTest(){add(newLabel(Hello”));add(newTextField(Hello”));add(newButton(Hello”));pack();show();}publicstaticvoidmain(Stringargs){newTest();}}Whatistheresult?()A.Thecodewillnotcompile.B.AWindowwillappearcontainingonlyaButton.C.AnIllegalArgumentExceptionisthrownatline6.D.AWindowbuttonwillappearbutwillnotcontaintheLabel,TextField,orButton.E.AWindowwillappearcontainingaLabelatthetop,aTextFieldbelowtheLabel,andaButtonbelowtheTextField.F.AWindowwillappearcontainingaLabelontheleft,aTextFieldtotherightoftheLabel,andabuttontotherightoftheTextField.

考题 下面程序代码运行结果为( )。 import java.awt.*; public class Test { public static void main (String args[]) { String s1="a+b+c"; String s2="+"; int i=s1.lastIndexOf (s2); System.out.println(i); } }A.0B.1C.2D.3

考题 以下哪个是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[] );

考题 下面哪个是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[])

考题 下面那个是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[])

考题 下列哪个是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[ ])

考题 设x,y均为已定义的类名,下列声明对象x1的语句不可能正确的是A.public x x1=new y();B.x x1=x();C.x x1=new x();D.public y x1=new x();