Which of the following methods cannot be invoked from the instance of Frame class in AWT?
-
setLocation(int, int)
-
setVisible(Boolean)
-
setSize(int, int)
-
setSize(int, int)
-
Pack()
D
Correct answer
Explanation
This function is not defined in the Frame class. This function is defined in JFrame class in Swings. So, this method cannot be invoked using the object of Frame class. But, can be invoked using the Object of JFrame class. This method specifies the operation when the frame is closed. Hence, this would be false. Frame f1 = new frame();f1.setDefaultCloseOperation(int); so this is the correct answer.