Multiple choice

The following program is written to create a frame. The program seems to be correct but when it is compiled, the compiler is not accepting it. Why?

class Myframe {
 public static void main(string_args[]) {
  Frame f = new frame("My frame");
  f.setsize(300, 250);
  f.setvisible(true);
 }
}

  1. Frame is not defined properly.

  2. Statement import java.awt.*; is missing.

  3. Statement import java.net.*; is missing.

  4. Statement import java.io.*; is missing.

  5. Set size is not defined properly.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This statement is must, because awt application is used to create the frame. This application is missing.