Multiple choice

Which of the following methods cannot be invoked from the instance of frame class in AWT?

public class If2
{
 static boolean b1, b2;
 public static void main(String [] args)
 {
 int x = 0;
 if ( !b1 ) /* Line 7 */
 {
 if ( !b2 ) /* Line 9 */ { b1 = true;
 x++; if ( 5 > 6 )
 {
 x++;
 }
 if ( !b1 ) x = x + 10;
 else if ( b2 = true ) /* Line 19 */ x = x + 100;
 else if ( b1 | b2 ) /* Line 21 */ x = x + 1000;
 }
 } System.out.println(x);
 }
 }

  1. setLocation(int, int)

  2. setVisible(Boolean)

  3. setSize(int, int)

  4. setDefaultCloseOperation(int)

  5. Pack()

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

This is the correct answer.