This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Question22: You need a container to hold six equal-sized button in the three columns of two. This arrangement must persist when the container is resized. Which of the following will create that container? A. Canvas c=new Canvas(new GridLayout(2,3)); B. Panel p=new Panel(new GridLayout(2,3)); C. Window w=new Window(new GridLayout(2,3)); D. Panel p=new Panel(new GridLayout(3,2)); Obviously, A & D are wrong, since Canvas is not a subclass of container, and D creates a GridLayout with 3 rows, 2 columns. But I don't know what's the difference here between B & C? Why the correct answer is B, not C? Thanks.