Question: 1 . Advantages to creating methods in addition to the main ( ) method include all of the following except _ _ _ _ _

1. Advantages to creating methods in addition to the main() method include all of the following except _____.
A. the main() method is easier to follow
B. all methods are prewritten, saving the programmer work
C. it is easier to determine the overall intent of statements encapsulated in the methods
D. methods are reusable
3. All method declarations contain _____________.
A. arguments
B. one or more explicitly named access specifiers
C. parentheses
D. the keyword static
5. Which of the following method declarations is correct for a static method named displayFacts() if the method receives an int argument?
A. public static int displayFacts()
B. public void displayFacts(int data)
C. public static void displayFacts(int data)
D. public void displayFacts(static int)
7. The method with the declaration public static int aMethod(double d) is a method type of _____________.
A. static
B. int
C. double
D. You cannot determine the method type.
9. A method is declared as public static void showResults(double d, int i). Which of the following is a correct method call?
A. showResults(double d, int i);
B. showResults(12.2,67);
C. showResults(4,99.7);
D. Two of these are correct.
11. The method public static boolean testValue(int response) returns _____________.
A. no value
B. an int value
C. a boolean value
D. You cannot determine what is returned.
13. In the method header public static boolean(int age), age is a(n)_____.
A. argument
B. parameter
C. return value
D. final value
15. When a block exists within another block, the blocks are _____________.
A. structured
B. illegal
C. sheltered
D. nested
17. You can declare variables with the same name multiple times _____________.
A. within a statement
B. within a block
C. within a method
D. You never can declare multiple variables with the same name.
19. If a method is written to receive a double parameter, and you pass an int to the method, then the method will _____________.
A. work correctly; the int will be promoted to a double
B. work correctly; the parameter type will automatically become an int
C. execute but issue a warning
D. not work; an error message will be issued

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!