








































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









































B) Dynamically executed loop C) User controlled loop D) Infinite loop - ANSWERAnswer: C
int x = 11; do { x += 20; } while (x > 100); A) 0 B) 1 C) 4 D) 5 - ANSWERAnswer: B
PrintWriter outFile = new PrintWriter(fwriter); B) FileWriter fwriter = new FileWriter("MyFile.txt"); PrintWriter outFile = new PrintWriter(fwriter); C) PrintWriter outfile = new PrintWriter("MyFile.txt", true); D) PrintWriter outfile = new PrintWriter(true, "MyFile.txt"); - ANSWERAnswer: A
B) its value may be changed within the called method C) values may not be passed to methods D) the method must not assign another value to the parameter that receives the argument - ANSWERAnswer: A
B) 18 (as an integer) C) 8 D) This is an error. - ANSWERAnswer: A
B) allows for code reuse C) simplifies programs D) all of the above - ANSWERAnswer: D
C) displayValue(a,b); // where a is a short and b is a long D) They would all give an error. - ANSWERAnswer: C
A) constants B) parameter values C) the results of an arithmetic operation D) any of the above - ANSWERAnswer: D
T/F: Constants, variables, and the values of expressions may be passed as arguments to a method. - ANSWERAnswer: TRUE T/F: A parameter variable's scope is the method in which the parameter is declared. - ANSWERAnswer: TRUE T/F: You must have a return statement in a value-returning method. - ANSWERAnswer: TRUE T/F: Any method that calls a method with a throws clause in its header must either handle the potential exception or have the same throws clause. - ANSWERAnswer: TRUE T/F: In the method header the static method modifier means the method is available to code outside the class. - ANSWERAnswer: FALSE T/F: Only constants and variables may be passed as arguments to methods. - ANSWERAnswer: FALSE
D) instance - ANSWERAnswer: B