Question: Refer to image for questions 1 through 5 - Question 1: True or False: The main method is called on line 9 above. Question 2:
Refer to image for questions 1 through 5 -
Question 1: True or False: The main method is called on line 9 above.
Question 2: On line 18 above, the name of the method that is being called is:
a) JOptionPane
b) JOptionPane.showMessageDialog
c) showMessageDialog
d) Display a dialog box on the screen.
Question 3: On line 18 above, how many actuals are sent to the method?
a) 1
b) 2
c) 3
d) 4
Question 4: True or False: Line 23 above is an example of a method call.
Question 5: On line 17, two methods are called. Which method returns first?
a) round
b) random
Question 6: True or False:
Consider the following statement:
JOptionPane.showMessageDialog(null, "Tricky Question");
showMessageDialog is a static method in the JOptionPane class.
Question 7: Which of the following (choose all that apply) can you use as resources to determine the methods that are available for you to call in a program?
a) Ask a fellow college student or colleague
b) Use the "intelli-sense" in Netbeans
c) Search the internet
d) Study the API
e) Email a Java Programmer
Question 8: True or False: When you call a method, the method can return at most 1 value.
Question 9: Consider the following code fragment:
int n;
Point p;
Color c;
c = new Color(200, 50, 128);
n = c.getRed( );
The getRed method:
a) is defined in the Point Class
b) is found in the object c
c) is defined in the Color class
d) is found in the object p
e) returns an int
Question 10: True or False: In the following statement:
c = Color.getColor("Cyan");
getColor is a static method of the Color class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
