Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

javaQuestion 1 Edit this Question Delete this Question 0 multiple_choice_questio

ID: 3856934 • Letter: J

Question

javaQuestion 1             

Edit this Question Delete this Question

0 multiple_choice_question 790642

<font>(TCOs 1, 3, and 6) Which of the following statements is false?</font>

(TCOs 1, 3, and 6) Which of the following statements is false?

Move To... This element is a more accessible alternative to drag & drop reordering. Press Enter or Space to move this question.       

        

Question 2 3 pts

Edit this Question Delete this Question

0 multiple_choice_question 790644

<font>(TCOs 1, 3, and 6) The data returned by JOptionPane.showInputDialog method is always _____ datatype.</font>

(TCOs 1, 3, and 6) The data returned by JOptionPane.showInputDialog method is always _____ datatype.

Move To... This element is a more accessible alternative to drag & drop reordering. Press Enter or Space to move this question.

        

Question 3 3 pts

Edit this Question Delete this Question

(TCOs 1, 3, and 6) A(n) _____ has a border and contains all of the normal window controls for your operating system, such as minimize, maximize, and close buttons.

(TCOs 1, 3, and 6) A(n) _____ has a border and contains all of the normal window controls for your operating system, such as minimize, maximize, and close buttons.

Move To... This element is a more accessible alternative to drag & drop reordering. Press Enter or Space to move this question.

        

Question 4 3 pts

Edit this Question Delete this Question

0 multiple_choice_question 790650

(TCOs 1, 3, and 6) Suppose a JFrame uses GridLayout(2,0). If you add six buttons to the frame, how many columns are displayed?</font>

(TCOs 1, 3, and 6) Suppose a JFrame uses GridLayout(2,0). If you add six buttons to the frame, how many columns are displayed?

A constructor can be overloaded.

Explanation / Answer

Question 1 ) Which of the following statements is false?

Answer 1) Satement 3 is false : A Constructor can specify return type or return values.

Reason: A constructor is a special function whose name is same as the name of the class. Constructors are used to initialize variables to defalt values. Constructors are automatically called as we create object of a class. They do not return any value so they do not have any return type. We do not write any return type with constructor definition.Overloading of constructor is common because we have three types of constructors : default, parameterized and copy, and we can create all the three constructors in a single class.

Question 2) The data returned by JOptionPane.showInputDialog method is always _____ datatype.

Answer 2) String datatype

Explaination: IOptionPane is a class library that popup simple dialog box that provide a message or ask for an input from user. showInputDialog method allows user to input. It contain a text box where user types there input. So these boxes return the input as a String.

Question 3) A(n) _____ has a border and contains all of the normal window controls for your operating system, such as minimize, maximize, and close buttons.

Answer 3) jPanel

Explaination: jPanel is a llightweight container. It provide space in which an application can attach any other component.

Question 4) Suppose a JFrame uses GridLayout(2,0). If you add six buttons to the frame, how many columns are displayed?

Answer 4) 3

Explaination: The syntax of GridLayout is

GridLayout(int rows,int columns)

A zero in row or column indicates any number of columns.

Here GridLayout is GridLayout(2,0) Which means there are 2 rows and any number of columns, because there is 0 columns.

so on adding 6 buttons they will be arranged as

as there has to be 2 rows but columns can be any.

So the answer is 3

Button 1 Button 2 Button 3 Button4 Button5 Button6