Question 1: True or False: The main method is called on line 9 above. Question 2
ID: 3915029 • Letter: Q
Question
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.
Explanation / Answer
question 1
ans . Yes its true Its a by defaul function , When you run the java file it will call the main function. It is the entry point of the program.
Quetion 2.
ans. C showMessageDialog .its method of jOptionPane class.
Question 3.
ans. c 3
actual argument sent is 3 with one null argument .
Question 4
ans
False . its a if condition its not a method call.
Question 5.
ans b random because it in the bracket so . braket expression are solved first then other.
Question 6
ans true jOptionPane has static showMessageDialog.
Question 7
ans b use intellisense netbeans
IntelliSense is a general term for a variety of code editing features including: code completion, parameter info, quick info, and member lists. IntelliSense features are sometimes called by other names such as "code completion", "content assist", and "code hinting.".
Question 8
ans False . If the method have return type void then method does not return anything.
Question 9
ans c Is defined in the Color class
Because c is the object of the color class.
Question 10
ans: true
its a static method. Because the static method can call with out creating object of its class.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.