Menu
Question Index
...

Which of the following option match for the given program?

import java.awt.*;
public class Layouts extends Frame {
    Layouts() {
        java.awt.Container container = new Container();
        container.setLayout(new GridLayout(3, 2));
        container.add(new java.awt.Button("A"));
        container.add(new java.awt.Button("B"));
        java.awt.Container container2 = new Container();
        container2.setLayout(new GridLayout(1, 1));
        container.add(container2);
        container2.add(new java.awt.Button("C"));
        container.add(new java.awt.Button("D"));
        container2.add(new java.awt.Button("E"));
        add(container);
        pack();
    }
    public static void main(String[] args) {
        new Layouts().show();
    }
}


|    A   |   B   |
| C | D |   E   |
|   A    |   B   |
| C | E |   D   |
|  A  |  B  |  D  |
|  C      |     E  |
|  A  |  B  |
|  C  |      |
|      |  D  |
|  E  |      |
Compilation Error or Runtime Error

Doubts

Problems

Topic: Other Advanced Topics In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App