Friday, September 4, 2009

SCJP Questions

Exhibit:
1 import java.awt*;
2
3 public class X extends Frame (
4 public static void main(string []args) (
5 X x = new X ();
6 X.pack();
7 x.setVisible(true);
8 )
9
10 public X () (
11 setlayout (new GridLayout (2,2));
12
13 Panel p1 = new panel();
14 Add(p1);
15 Button b1= new Button ("One");
16 P1.add(b1);
17
18 Panel p2 = new panel();
19 Add(p2);
20 Button b2= new Button ("Two");
21 P2.add(b2);
22
23 Button b3= new Button ("Three");
24 add(b3);
25
26 Button b4= new Button ("Four");
27 add(b4);
28 )
29 )
Which two statements are true? (Choose Two)
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.
Answer: C, D

0 comments:

Post a Comment

 

About

Site Info

Information Source

Academy of JAVA by Rajesh Rolen Copyright © 2009 Community is Developed by Rajesh Kumar Rolen WebSite

/* tracking code by yahoo login */