143k views
3 votes
The setVisible method of the JFrame class returns what kind of argument?

a) The setVisible method does not return a result.
b) The setVisible method returns an integer value.
c) The setVisible method returns a String object.
d) The setVisible method returns a JFrame object.

1 Answer

3 votes

Final answer:

The setVisible method of the JFrame class does not return any value as it is a void method. It is used to show or hide the associated window.

Step-by-step explanation:

The setVisible method is a part of the JFrame class in Java Swing, which is used to show or hide a window. When you call setVisible(true) on a JFrame object, it makes the window visible; conversely, setVisible(false) makes the window not visible. Importantly, the setVisible method does not return any value; it is a void method. Therefore, the correct answer to what kind of argument the setVisible method returns is:

a) The setVisible method does not return a result.

User Laurentiu Stamate
by
8.7k points