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.
identify method calls - NetBeans IDE 8.0 Eile Edit Yiew Navigate Source Refgctor Bun Debug Profile Team Iools Window Help . Search (C-I) config> public class IdentifyMethodCalls publie statie void aia(Stzingt args) 10 char c long n, quess, boolean correet-alse: Sering anum Scanner keyboard keyboard-neM Scanner (System.in) 13 14 15 16 17 18 19 20 21 Hath. round (Math randon0101) JOptionPane. shovMessageDialog (null, "Guess y number from 1 to 10 below. while (correct) "Guessing Game". JOpeionPane.PLAIN MESSAGE) Syatem.out-print(Enter your ques guess- keyboard.nexcLongO if (guessn) 23 24 Systese.out.printin ("Congrats! My number was. " n); correce -true 26 27 else 29 30 31 32 Syatem.out.printin("Nope Try again 34 main while (icorrect) 20:7 NSStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started