多项选择题
import java.awt*;
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= new Button (“One”);
P1.add(b1);
Panel p2 = new panel();
Add(p2);
Button b2= new Button (“Two”);
P2.add(b2);
Button b3= new Button (“Three”);
add(b3);
Button b4= new Button (“Four”);
add(b4);
)
)
Which two statements are true? ()
A. All the buttons change height if the frame height is resized.
B. All the buttons change width if the Frame width is resized.
C. The size of the button labeled “One” is constant even if the Frame is resized.
D. Both width and height of the button labeled “Three” might change if the Frame is resized.
相关考题
- 单项选择题 WhichisamethodoftheMouseMotionListenerinterface?()
- 单项选择题 GiventheActionEvent,whichmethodallowsyoutoidentifytheaffectedcomponent?()
- 单项选择题 public class returnIt ( returnType methodA(byte x, double y) ( return (short) x/y * 2; ) ) What is the valid returnType for methodA in line 2?()
- 单项选择题 class super ( public int I = 0; public super (string text) ( I = 1 ) ) public class sub extends super ( public sub (string text) ( i= 2 ) public static void main (straing args) ( sub sub = new sub (“Hello”); system.out. PrintIn(sub.i); ) ) What is the result?()
- 单项选择题 byte arry1, array2; byte array3 ; byte array4; If each array has been initialized, which statement will cause a compiler error?()
- 单项选择题 Whichdeclarationpreventscreatingasubclassofanouterclass?()
- 单项选择题 class super { public float getNum() {return 3.0f;} } public class Sub extends Super { } Which method, placed at line 6, will cause a compiler error?()
- 单项选择题 public class test( public int aMethod()[ static int i=0; i++; return I; ) public static void main (String args){ test test = new test(); test.aMethod(); int j = test.aMethod(); System.out.printIn(j); ] } What is the result?()
- 单项选择题 abstract class abstrctIt { abstract float getFloat (); } public class AbstractTest extends AbstractIt { private float f1= 1.0f; private float getFloat () {return f1;} } What is the result? ()
- 单项选择题 Youwantsubclassesinanypackagetohaveaccesstomembersofasuperclass.Whichisthemostrestrictiveaccessmodifierthatwillaccomplishthisobjective?()
- 单项选择题 Whichwilldeclareamethodthatforcesasubclasstoimplementit?()
- 单项选择题 public class foo { public static void main (Stringargs) { String s; system.out.printIn (“s=” + s); } } What is the result?()
- 单项选择题 下列代码的执行结果是()int index = 1; int foo[] = new int [3]; int bar = foo [index] int baz = bar + index;
- 单项选择题 public class test( public static void main(stringargs){ string foo = args [1]; string foo = args ; string foo = args ; } ) And command line invocation: Java Test red green blue What is the result? ()
- 单项选择题 int index = 1; boolean test = new Boolean; boolean foo= test [index]; What is the result?()
- 多项选择题 Whichthreearevaliddeclarationsofafloat?()
- 多项选择题 WhichtwostatementsarereservedwordsinJava?()
- 单项选择题 //point X public class foo ( public static void main (Stringargs) throws Exception { printWriter out = new PrintWriter (new ) java.io.outputStreamWriter (System.out), true; out.printIn(“Hello”); } ) Which statement at PointX on line 1 allows this code to compile and run?()
- 单项选择题 interface foo { int k = 0; } public class test implements Foo ( public static void main(String args) ( int i; Test test = new test (); i= test.k; i= Test.k; i= Foo.k; ) ) What is the result? ()
- 单项选择题 public class enclosingone ( public class insideone{} ) public class inertest( public static void main (stringargs)( enclosingone eo= new enclosingone (); //insert code here ) ) Which statement at line 7 constructs an instance of the inner class?()