Test
Java Practice 1
Preguntas del test (200)
1________is a technical definition of the language that includes the syntax and semantics of the Java programming language.
- AJava JDK
- BJava language specification
- CJava IDE
- DJava API
2Which JDK command is correct to run a Java application in ByteCode.class?
- Ajava ByteCode.class
- Bjavac ByteCode.java
- Cjavac ByteCode
- DJAVAC ByteCode
- Ejava ByteCode
3________ is a software that interprets Java bytecode.
- AJava virtual machine
- BJava API
- CJava compiler
- DJava debugger
4________ is an operating system.
- AVisual Basic
- BAda
- CC++
- DWindows XP
- EJava
5Which of the following are the reserved words? (Choose all that apply.)
- Avoid
- Bclass
- Cstatic
- Dpublic
6________is interpreted.
- AAda
- BPascal
- CJava
- DC++
- EC
7________ contains predefined classes and interfaces for developing Java programs.
- AJava JDK
- BJava API
- CJava language specification
- DJava IDE
8Which of the following statements is correct?
- AEvery line in a program must end with a semicolon.
- BEvery comment line must end with a semicolon.
- CEvery method must end with a semicolon.
- DEvery class must end with a semicolon.
- EEvery statement in a program must end with a semicolon.
9________provides an integrated development environment (IDE) for rapidly developing Java programs. Editing, compiling, building, debugging, and online help are integrated in one graphical user interface.
- AJava JDK
- BJava language specification
- CJava API
- DJava IDE
10Java was developed by ________.
- ACisco Systems
- BSun Microsystems
- COracle
- DMicrosoft
- EIBM
11Java compiler translates Java source code into ________.
- Aassembly code
- Banother high-level language code
- CJava bytecode
- Dmachine code
12Suppose you define a Java class as follows:
public class Test {
}
In order to compile this program, the source code should be stored in a file named- ATest.class
- BAny name with extension .java
- CTest.java
- DTest.doc
- ETest.txt
13________is Architecture-Neutral.
- AC++
- BPascal
- CJava
- DAda
- EC
14Java ________ can run from a Web browser.
- Aservlets
- BMicro Edition programs
- Capplets
- Dapplications
15________ is the brain of a computer.
- ADisk
- BMemory
- CCPU
- DHardware
16The expression "Java " + 1 + 2 + 3 evaluates to ________.
- AJava123
- Bjava 123
- CJava 123
- DJava6
- EIllegal expression
17If a program compiles fine, but it produces incorrect result, then the program suffers ________.
- Aa compilation error
- Ba logic error
- Ca runtime error
18Which of the following code displays the area of a circle if the radius is positive?
- Aif (radius <= 0) System.out.println(radius * radius * 3.14159);
- Bif (radius >= 0) System.out.println(radius * radius * 3.14159);
- Cif (radius > 0) System.out.println(radius * radius * 3.14159);
- Dif (radius != 0) System.out.println(radius * radius * 3.14159);
19What is 1 + 1 + 1 + 1 + 1 == 5?
- AThere is no guarantee that 1 + 1 + 1 + 1 + 1 == 5 is true.
- Btrue
- Cfalse
20Suppose x is 1. What is x after x += 2?
- A2
- B3
- C1
- D4
- E0
21Which of the following expression results in a value 1?
- A2 % 1
- B25 % 5
- C15 % 4
- D37 % 6
22Which of the following are correct names for variables according to Java naming conventions? (Choose all that apply.)
- AFindArea
- BRADIUS
- CRadius
- DfindArea
- Eradius
23What is x after the following statements?
int x = 1;
x *= x + 1;- Ax is 2.
- Bx is 3.
- Cx is 1.
- Dx is 4.
24What is the result of 45 / 4?
- A11
- B11.25
- C12
- D10
25Analyze the following code:
boolean even = false;
if (even = true) {
System.out.println("It is even!");
}- AThe program has a compile error.
- BThe program runs fine and displays It is even!.
- CThe program has a runtime error.
- DThe program runs fine, but displays nothing.
26What is i printed in the following code?
public class Test {
public static void main(String[ ] args) {
int j = 0;
int i = j++ + j * 5;
System.out.println("What is i? " + i);
}
}- A6
- B1
- C5
- D0
2725 % 1 is ________.
- A3
- B1
- C4
- D2
- E0
28Analyze the following code. (Choose all that apply.)
int count = 0;
while (count < 100) {
// Point A
System.out.println("Welcome to Java!");
count++;
// Point B
}
// Point C- Acount < 100 is always false at Point C
- Bcount < 100 is always true at Point A
- Ccount < 100 is always true at Point C
- Dcount < 100 is always false at Point B
- Ecount < 100 is always true at Point B
29How many times will the following code print "Welcome to Java"?
int count = 0;
while (count < 10) {
System.out.println("Welcome to Java");
count++;
}- A11
- B9
- C0
- D8
- E10
30Suppose x is a char variable with a value 'b'. What is the printout of the statement System.out.println(++x)?
- Ac
- Ba
- Cd
- Db
31Analyze the following code:
Code 1:
boolean even;
if (number % 2 == 0)
even = true;
else
even = false;
Code 2:
boolean even = (number % 2 == 0);- ACode 2 has compile errors.
- BBoth Code 1 and Code 2 have compile errors.
- CCode 1 has compile errors.
- DBoth Code 1 and Code 2 are correct, but Code 2 is better.
32Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?
- A1 < x < 100 && x < 0
- B((x < 100) && (x > 1)) || (x < 0)
- C((x < 100) && (x > 1)) && (x < 0)
- D(1 > x > 100) || (x < 0)
33Suppose x=10 and y=10 what is x after evaluating the expression (y > 10) && (x++ > 10)?
- A9
- B11
- C10
34What is 1.0 + 1.0 + 1.0 + 1.0 + 1.0 == 5.0?
- Atrue
- Bfalse
- CThere is no guarantee that 1.0 + 1.0 + 1.0 + 1.0 + 1.0 == 5.0 is true.
35What is the printout of the following switch statement?
char ch = 'a';
switch (ch) {
case 'a':
case 'A':
System.out.print(ch); break;
case 'b':
case 'B':
System.out.print(ch); break;
case 'c':
case 'C':
System.out.print(ch); break;
case 'd':
case 'D':
System.out.print(ch);
}- Aa
- Baa
- Cabcd
- Dabc
- Eab
36What is y after the following switch statement is executed?
x = 3;
switch (x + 3) {
case 6: y = 0;
case 7: y = 1;
default: y += 1;
}- A3
- B1
- C2
- D4
37Which of the following statements are true? (Choose all that apply.)
- A(x > 0 || x < 10 && y < 0) is same as (x > 0 || (x < 10 && y < 0))
- B(x > 0 || x < 10) is same as ((x > 0) || (x < 10))
- C(x > 0 || x < 10 && y < 0) is same as ((x > 0 || x < 10) && y < 0)
- D(x > 0 && x < 10) is same as ((x > 0) && (x < 10))
38What is the printout of the following switch statement?
char ch = 'b';
switch (ch) {
case 'a':
System.out.print(ch);
case 'b':
System.out.print(ch);
case 'c':
System.out.print(ch);
case 'd':
System.out.print(ch);
}- Ab
- Bbb
- Cbcd
- Dabcd
- Ebbb
39Analyze the following program fragment:
int x;
double d = 1.5;
switch (d) {
case 1.0: x = 1;
case 1.5: x = 2;
case 2.0: x = 3;
}- ANo errors.
- BThe program has a compile error because the required break statement is missing in the switch statement.
- CThe switch control variable cannot be double.
- DThe program has a compile error because the required default case is missing in the switch statement.
40Which of the following are valid specifiers for the printf statement? (Choose all that apply.)
- A%6d
- B%10b
- C%4c
- D%8.2d
- E%10.2e
41Analyze the following code.
boolean even = false;
if (even) {
System.out.println("It is even!");
}- AThe code displays It is even!
- BThe code is wrong. You should replace if (even) with if (even = true)
- CThe code is wrong. You should replace if (even) with if (even == true)
- DThe code displays nothing.
42Suppose x=10 and y=10. What is x after evaluating the expression (y > 10) && (x-- > 10)?
- A10
- B11
- C9
43The "less than or equal to" comparison operator in Java is ________.
- A<
- B!=
- C<=
- D=<
- E<<
44What is the output of the following code?
char ch = 'F';
if (ch >= 'A' && ch <= 'Z')
System.out.println(ch);- AF
- Bf
- Cnothing
- DF f
45________ is the code with natural language mixed with Java code.
- APseudocode
- BA Java statement
- CA flowchart diagram
- DJava program
46The statement System.out.printf("%3.1e", 1234.56) outputs ________.
- A1.23+03
- B1.2e+03
- C0.1e+04
- D0.123456e+04
- E0.123e+04
47Suppose income is 4001, what is the output of the following code:
if (income > 3000) {
System.out.println("Income is greater than 3000");
}
else if (income > 4000) {
System.out.println("Income is greater than 4000");- AIncome is greater than 3000 followed by Income is greater than 4000
- BIncome is greater than 3000
- CIncome is greater than 4000 followed by Income is greater than 3000
- Dno output
- EIncome is greater than 4000
48Suppose x=10 and y=10 what is x after evaluating the expression (y >= 10) || (x++ > 10)?
- A11
- B10
- C9
49Analyze the following code fragments that assign a boolean value to the variable even.
Code 1:
if (number % 2 == 0)
even = true;
else
even = false;
Code 2:
even = (number % 2 == 0) ? true: false;
Code 3:
even = number % 2 == 0;- AAll three are correct, but Code 1 is preferred.
- BAll three are correct, but Code 3 is preferred.
- CCode 3 has a compile error, because you attempt to assign number to even.
- DCode 2 has a compile error, because you cannot have true and false literals in the conditional expression
- EAll three are correct, but Code 2 is preferred.
50What is the value of the following expression?
true || true && false- Atrue
- Bfalse
51Suppose x = 1, y = -1, and z = 1. What is the printout of the following statement?
if (x > 0)
if (y > 0)
System.out.println("x > 0 and y > 0");
else if (z > 0)
System.out.println("x < 0 and z > 0");- Ax < 0 and z < 0;
- Bno printout.
- Cx > 0 and y > 0;
- Dx < 0 and z > 0;
52"AbA".compareToIgnoreCase("abC") returns ________.
- A1
- B2
- C-1
- D-2
- E0
53What is the printout of System.out.println('z' - 'a')?
- A25
- B26
- Ca
- Dz
54Assume that the ASCII code for character c is 99 and for a is 97. What is the printout of the following code?
System.out.println('a' + 'c');- Aa99
- Bac
- C9799
- D196
55Note that the Unicode for character A is 65. The expression "A" + 1 evaluates to ________.
- A66
- BB
- CA1
- DIllegal expression
56Which of the following method results in 8.0?
- AMath.round(8.5)
- BMath.rint(8.5)
- CMath.ceil(8.5)
- DMath.floor(8.5)
57The expression 'c' - 'e' is ________.
- A2
- B-2
- Ca random number
- Dinvalid
58Math.ceil(5.5) evaluates to ________.
- A5.0
- B6.0
- C5
- D6
59Math.floor(5.5) evaluates to ________.
- A5.0
- B6.0
- C5
- D6
60To obtain the sine of 35 degrees, use ________.
- AMath.sin(35)
- BMath.sin(Math.toRadians(35))
- CMath.sin(Math.toDegrees(35))
- DMath.sin(Math.toRadian(35))
- EMath.sin(Math.toDegree(35))
61Which of the following is the correct expression of character a?
- A'a'
- B"a"
- C'\000a'
- D'\a'
62Math.cos(Math.PI) returns ________.
- A0.0
- B1.0
- C-1.0
- D0.5
63Which of the following assignment statements is correct?
- Achar c = 'd';
- Bchar c = 100;
- Cchar c = "d";
- Dchar c = "100";
64What is i after the following for loop?
int y = 0;
for (int i = 0; i<10; ++i) {
y += i;
}- A9
- Bundefined
- C10
- D11
65Which of the following will not help prevent infinite loops?
- AEnsure that the header of a for or while statement is not followed by a semicolon.
- BIf the loop is counter-controlled, the body of the loop should increment or decrement the counter as needed.
- CIf the loop is sentinel-controlled, ensure that the sentinel value is input eventually.
- DInclude braces around the statements in a do..while statement.
66How many times will the following code print "Welcome to Java"?
int count = 0;
do {
System.out.println("Welcome to Java");
} while (++count < 10);- A9
- B10
- C0
- D11
- E8
67For the code segment below:
switch( q )
{
case 1:
System.out.println( "apple" );
break;
case 2:
System.out.println( "orange" );
break;
case 3:
System.out.println( "banana" );
break;
case 4:
System.out.println( "pear" );
case 5:
System.out.println( "grapes" );
default:
System.out.println( "kiwi" );
} // end switch
Which of the following values for q will result in kiwi being included in the output?- A2
- B3
- CAnything greater than or equal to 4.
- D1
68Which of the following for-loop control headers results in equivalent numbers of iterations:
A. for ( int q = 1; q <= 100; q++ )
B. for ( int q = 100; q >= 0; q-- )
C. for ( int q = 99; q > 0; q -= 9 )
D. for ( int q = 990; q > 0; q -= 90 )- AC and D.
- BA and B.
- CNone of the loops have equivalent iterations.
- DA and B have equivalent iterations and C and D have equivalent iterations.
69To exit out of a loop completely, and resume the flow of control at the next line in the method, use _______.
- AA continue statement.
- BA break statement.
- CA return statement.
- DAny of the above.
70What is the value in count after the following loop is executed?
int count = 0;
do {
System.out.println("Welcome to Java");
} while (count++ < 9);
System.out.println(count);- A0
- B8
- C9
- D11
- E10
71What is sum after the following loop terminates?
int sum = 0;
int item = 0;
do {
item++;
sum += item;
if (sum >= 4) continue;
}
while (item < 5);- A15
- B18
- C17
- D16
72What is the output for y?
int y = 0;
for (int i = 0; i<10; ++i) {
y += i;
}
System.out.println(y);- A11
- B13
- C45
- D10
- E12
73Which of the following is not a type of repetition statement in Java?
- Ado¦while statements.
- Bfor statements.
- Cwhile statements.
- Dloop statements.
74Which of the following statements about the continue statement is true?
- AThe continue statement is used to continue after a switch statement.
- BThe continue statement is used to exit a repetition structure early and continue execution after the loop.
- CThe continue statement does not alter the flow of control.
- DA continue statement proceeds with the next iteration of the immediately enclosing while, for, do¦while statement.
75Suppose the input for number is 9. What is the output from running the following program?
import java.util.Scanner;
public class Test {
public static void main(String[ ] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter an integer: ");
int number = input.nextInt();
int i;
boolean isPrime = true;
for (i = 2; i < number && isPrime; i++) {
if (number % i == 0) {
isPrime = false;
}
}
System.out.println("i is " + i);
if (isPrime)
System.out.println(number + " is prime");
else
System.out.println(number + " is not prime");
}
}- Ai is 4 followed by 9 is prime
- Bi is 3 followed by 9 is not prime
- Ci is 3 followed by 9 is prime
- Di is 4 followed by 9 is not prime
76Analyze the following code: (Choose all that apply.)
public class Test {
public static void main (String args[ ]) {
int i = 0;
for (i = 0; i < 10; i++);
System.out.println(i + 4);
}
}- AThe program has a compile error because of the semicolon (;) on the for loop line.
- BThe for loop in this program is same as for (i = 0; i < 10; i++) { }; System.out.println(i + 4);
- CThe program compiles despite the semicolon (;) on the for loop line, and displays 14.
- DThe program compiles despite the semicolon (;) on the for loop line, and displays 4.
77The parameter list in the method header and the arguments in the method call must agree in:
- Atype
- Bnumber
- Corder
- Dall the above
78What is Math.rint(3.5)?
- A5.0
- B4.0
- C3.0
- D3
- E4
79Which is a correct static method call of Math class method sqrt?
- AMath.sqrt( 900 );.
- Bsqrt( 900 );.
- Cmath.sqrt( 900 );.
- DMath math = new Math(); math.sqrt( 900 );.
80You can set a Random object's seed at any time during program execution by calling the object's ________ methods.
- AupdateSeed.
- BsetSeed
- CchangeSeed.
- DresetSeed.
81Identifiers in Java have ________ and ________ scopes?
- Astatement, file.
- Bclass, block.
- Cmethod, class.
- Dblock, statement.
82A well-designed method
- Acontains thousands of lines of code.
- Bperforms multiple unrelated tasks.
- Crepeats code found in other methods.
- Dperforms a single, well-defined task.
83Which of the following methods is not in the Math class?
- AparseInt.
- Babs.
- Cceil.
- Dlog.
84Which statement below could be used to simulate the outputs of rolling a six-sided die? Suppose randomNumbers is a Random object.
- A1 + randomNumbers.nextInt( 2 );
- B6 + randomNumbers.nextInt( 1 );
- C3 + randomNumbers.nextInt( 3 );
- D1 + randomNumbers.nextInt( 6 );
85Which of the following can be an argument to a method?
- AConstants.
- BVariables.
- CExpressions.
- DAll of the above.
86To declare a method as static, place the keyword static before ________ in the method's declaration
- Athe return type.
- Bthe method name.
- Cthe argument list.
- Dthe method modifier.
87Analyze the following code:
public class Test {
public static void main(String[ ] args) {
System.out.println(xMethod(5, 500L));
}
public static int xMethod(int n, long l) {
System.out.println("int, long");
return n;
}
public static long xMethod(long n, long l) {
System.out.println("long, long");
return n;
}
}- AThe program displays int, long followed by 5.
- BThe program displays long, long followed by 5.
- CThe program runs fine but displays things other than 5.
- DThe program does not compile because the compiler cannot distinguish which xmethod to invoke.
88Declaring main as ________ allows the JVM to invoke main without creating an instance of the class.
- Avoid.
- Bpublic.
- Cfinal.
- Dstatic.
89Variables should be declared as fields only if
- Athey are used only within a method.
- Bthey are local variables.
- Cthey are required for use in more than one method or their values must be saved between calls to the class's methods.
- Dthey are arguments.
90Which of the following methods are overloaded with respect to one another?
A. public int max ( int a, int b ) { … }
B. public double max ( double a, double b ) { … }
C. public int max ( int a, int b, int c ) { … }
D. public double max ( double a, double b, double c ) { … }- AA and B are overloaded; C and D are overloaded.
- BA and C are overloaded; B and D are overloaded.
- CAll these four methods are overloaded.
- DA, B and C are overloaded.
91The identifiers in an enumeration ________.
- Amust be lowercase letters and cannot contain numbers.
- Bmust be unique.
- Cmust be uppercase letters and cannot contain numbers.
- Dmay be duplicated.
92Analyze the following code.
public class Test {
public static void main(String[ ] args) {
System.out.println(max(1, 2));
}
public static double max(int num1, double num2) {
System.out.println("max(int, double) is invoked");
if (num1 > num2)
return num1;
else
return num2;
}
public static double max(double num1, int num2) {
System.out.println("max(double, int) is invoked");
if (num1 > num2)
return num1;
else
return num2;
}
}- AThe program cannot compile because the compiler cannot determine which max method should be invoked.
- BThe program runs and prints 2 followed by "max(int, double)" is invoked.
- CThe program cannot compile because you cannot have the print statement in a non-void method.
- DThe program runs and prints "max(int, double) is invoked" followed by 2.
- EThe program runs and prints 2 followed by "max(double, int)" is invoked.
93What is Math.floor(3.6)?
- A3.0
- B5.0
- C4
- D3
94What is Math.round(3.6)?
- A3.0
- B3
- C4
- D4.0
95(int)('a' + Math.random() * ('z' - 'a' + 1)) returns a random number ________.
- Abetween 'a' and 'z'
- Bbetween (int)'a' and (int)'z'
- Cbetween 0 and (int)'z'
- Dbetween 'a' and 'y'
96Given the following method
static void nPrint(String message, int n) {
while (n > 0) {
System.out.print(message);
n--;
}
}
What is k after invoking nPrint("A message", k)?
int k = 2;
nPrint("A message", k);- A3
- B0
- C1
- D2
97Does the method call in the following method cause compile errors?
public static void main(String[ ] args) {
Math.pow(2, 4);
}- AYes
- BNo
98Method calls cannot be distinguished by ________.
- Areturn type.
- Bmethod name.
- Cmethod signature.`
- Dparameter lists.
99________ is to implement one method in the structure chart at a time from the top to the bottom.
- ABottom-up approach
- BStepwise refinement
- CBottom-up and top-down approach
- DTop-down approach
100Which of the following is a possible output from invoking Math.random()? (Choose all that apply.)
- A3.43
- B0.0
- C1.0
- D0.5
101Which statement below could be used to simulate the outputs of tossing a quarter to get heads or tails? Suppose randomNumbers is a Random object.
- ArandomNumbers.nextInt( 7 );
- BrandomNumbers.nextInt( 1 );
- CrandomNumbers.nextInt( 2 );
- DrandomNumbers.nextInt( 25 );
102A Java class can have which of the following methods?
A. void foo( int a )
B. void foo( int a, int b )
C. void foo( double a )
D. void foo( double a, double b )
E. void foo( int b )- AA, B, C, D.
- BAll of the above.
- CA, C, D, E.
- DA, B, D, E.
103If more method calls occur than can have their activation records stored on the program execution stack, an error known as a ________ occurs.
- Astack empty.
- Bstack overflow.
- Cstack full.
- Dstack rewind.
104Which statement creates a random value from the sequence 2, 5, 8, 11 and 14. Suppose randomNumbers is a Random object.
- A3 + 2 * randomNumbers.nextInt( 5 );
- B5 + 3 * randomNumbers.nextInt( 2 );
- C2 + 3 * randomNumbers.nextInt( 5 );
- D2 + 5 * randomNumbers.nextInt( 3 );
105Analyze the following code:
public class Test {
public static void main(String[ ] args) {
final int[ ] x = {1, 2, 3, 4};
int[ ] y = x;
x = new int[2];
for (int i = 0; i < y.length; i++)
System.out.print(y[i] + " ");
}
}- AThe program displays 0 0
- BThe program displays 1 2 3 4
- CThe program has a compile error on the statement x = new int[2], because x is final and cannot be changed.
- DThe elements in the array x cannot be changed, because x is final.
106For the binarySearch method in Section 6.9.2, what is low and high after the first iteration of the while loop when invoking binarySearch(new int[ ]{1, 4, 6, 8, 10, 15, 20}, 11)?
- Alow is 3 and high is 6
- Blow is 0 and high is 5
- Clow is 4 and high is 6
- Dlow is 0 and high is 6
- Elow is 0 and high is 3
107Analyze the following code.
public class Test {
public static void main(String[ ] args) {
int[ ] x = new int[3];
System.out.println("x[0] is " + x[0]);
}
}- AThe program has a runtime error because the array element x[0] is not defined.
- BThe program runs fine and displays x[0] is 0.
- CThe program has a compile error because the size of the array wasn't specified when declaring the array.
- DThe program has a runtime error because the array elements are not initialized.
108Assume int[ ] scores = {1, 20, 30, 40, 50}, what value does java.util.Arrays.binarySearch(scores, 30) return?
- A1
- B-1
- C2
- D-2
- E0
109Analyze the following code:
public class Test {
public static void main(String[ ] args) {
int[ ] x = new int[5];
int i;
for (i = 0; i < x.length; i++)
x[i] = i;
System.out.println(x[i]);
}
}- AThe program has a compile error because i is not defined in the last statement in the main method.
- BThe program has a runtime error because the last statement in the main method causes ArrayIndexOutOfBoundsException.
- CThe program displays 4.
- DThe program displays 0 1 2 3 4.
110The reverse method is defined in the textbook. What is list1 after executing the following statements?
int[ ] list1 = {1, 2, 3, 4, 5, 6};
list1 = reverse(list1);- Alist1 is 6 5 4 3 2 1
- Blist1 is 0 0 0 0 0 0
- Clist1 is 1 2 3 4 5 6
- Dlist1 is 6 6 6 6 6 6
111What would be the result of attempting to compile and run the following code?
public class Test {
public static void main(String[ ] args) {
double[ ] x = new double[ ]{1, 2, 3};
System.out.println("Value is " + x[1]);
}
}- AThe program has a compile error because the syntax new double[ ]{1, 2, 3} is wrong and it should be replaced by new double[ ]{1.0, 2.0, 3.0};
- BThe program compiles and runs fine and the output "Value is 1.0" is printed.
- CThe program compiles and runs fine and the output "Value is 2.0" is printed.
- DThe program has a compile error because the syntax new double[ ]{1, 2, 3} is wrong and it should be replaced by new double[3]{1, 2, 3};
- EThe program has a compile error because the syntax new double[ ]{1, 2, 3} is wrong and it should be replaced by {1, 2, 3}.
112Do the following two programs produce the same result?
Program I:
public class Test {
public static void main(String[ ] args) {
int[ ] list = {1, 2, 3, 4, 5};
reverse(list);
for (int i = 0; i < list.length; i++)
System.out.print(list[i] + " ");
}
public static void reverse(int[ ] list) {
int[ ] newList = new int[list.length];
for (int i = 0; i < list.length; i++)
newList[i] = list[list.length - 1 - i];
list = newList;
}
}
Program II:
public class Test {
public static void main(String[ ] args) {
int[ ] oldList = {1, 2, 3, 4, 5};
reverse(oldList);
for (int i = 0; i < oldList.length; i++)
System.out.print(oldList[i] + " ");
}
public static void reverse(int[ ] list) {
int[ ] newList = new int[list.length];
for (int i = 0; i < list.length; i++)
newList[i] = list[list.length - 1 - i];
list = newList;
}
}- AYes
- BNo
113Which of the following statements is valid? (Choose all that apply.)
- Aint[ ] i = {3, 4, 3, 2};
- Bchar[ ] c = new char();
- Cint i = new int(30);
- Dchar[ ] c = new char[4]{'a', 'b', 'c', 'd'};
- Edouble d[ ] = new double[30];
114The selectionSort method is defined in this section. What is list1 after executing the following statements?
double[ ] list1 = {3.1, 3.1, 2.5, 6.4};
selectionSort(list1);- Alist1 is 3.1, 2.5, 3.1, 6.4
- Blist1 is 3.1, 3.1, 2.5, 6.4
- Clist1 is 2.5 3.1, 3.1, 6.4
- Dlist1 is 6.4, 3.1, 3.1, 2.5
115If a key is not in the list, the binarySearch method returns ________.
- A-(insertion point + 1)
- B-insertion point
- Cinsertion point - 1
- Dinsertion point
116How can you initialize an array of two characters to 'a' and 'b'? (Choose all that apply.)
- Achar[2] charArray = {'a', 'b'};
- Bchar[ ] charArray = new char[2]; charArray = {'a', 'b'};
- Cchar[ ] charArray = new char[ ]{'a', 'b'};
- Dchar[ ] charArray = {'a', 'b'};
117What is the correct term for numbers[99]?
- Aarray
- Barray variable
- Cindexed variable
- Dindex
- Eindex variable
118If you declare an array double[ ] list = {3.4, 2.0, 3.5, 5.5}, list[1] is ________.
- A3.4
- B5.5
- C2.0
- Dundefined
119The ________ method sorts the array scores of the double[ ] type.
- Ajava.util.Arrays.sort(scores)
- Bjava.util.Arrays(scores)
- Cjava.util.Arrays.sorts(scores)
- DNjava.util.Arrays.sortArray(scores)
120Which of the following is incorrect? (Choose all that apply.)
- Aint a = new int[2];
- Bint[ ] a = new int[2];
- Cint a() = new int[2];
- Dint[ ] a = new int(2);
- Eint a[ ] = new int[2];
121Which of the following statements are correct? (Choose all that apply.)
- Achar[ ][ ][ ] charArray = new char[2][2][ ];
- Bchar[ ][ ][ ] charArray = {{{'a', 'b'}, {'c', 'd'}, {'e', 'f'}}};
- Cchar[2][2][ ] charArray = {'a', 'b'};
- Dchar[ ][ ][ ] charArray = {{'a', 'b'}, {'c', 'd'}, {'e', 'f'}};
122Assume double[ ][ ] x = new double[4][5], what are x.length and x[2].length?
- A4 and 5
- B5 and 5
- C5 and 4
- D4 and 4
123Suppose a method p has the following heading:
public static int[ ][ ] p()
What return statement may be used in p()?- Areturn {1, 2, 3};
- Breturn 1;
- Creturn new int[ ]{1, 2, 3};
- Dreturn int[ ]{1, 2, 3};
- Ereturn new int[ ][ ]{{1, 2, 3}, {2, 4, 5}};
124Assume int[ ] scores = {1, 20, 30, 40, 50}, what value does java.util.Arrays.binarySearch(scores, 3) return?
- A1
- B-2
- C2
- D0
- E-1
125What is the representation of the third element in an array called a?
- Aa(3)
- Ba(2)
- Ca[2]
- Da[3]
126Which of the following statements are correct?
- Achar[2][ ] charArray = {{'a', 'b'}, {'c', 'd'}};
- Bchar[ ][ ] charArray = {{'a', 'b'}, {'c', 'd'}};
- Cchar[ ][ ] charArray = {'a', 'b'};
- Dchar[2][2] charArray = {{'a', 'b'}, {'c', 'd'}};
127Assume double[ ][ ][ ] x = new double[4][5][6], what are x.length, x[2].length, and x[0][0].length?
- A4, 5, and 6
- B5, 5, and 5
- C4, 5, and 4
- D6, 5, and 4
128Analyze the following code:
public class Test {
public static void main(String[ ] args) {
boolean[ ][ ] x = new boolean[3][ ];
x[0] = new boolean[1]; x[1] = new boolean[2];
x[2] = new boolean[3];
System.out.println("x[2][2] is " + x[2][2]);
}
}- AThe program has a runtime error because x[2][2] is null.
- BThe program runs and displays x[2][2] is false.
- CThe program has a compile error because new boolean[3][ ] is wrong.
- DThe program runs and displays x[2][2] is true.
- EThe program runs and displays x[2][2] is null.
129Which of the following statements are correct to invoke the printMax method in Listing 6.5 in the textbook? (Choose all that apply.)
- AprintMax(1.0, 2.0, 2.0, 1.0, 4.0);
- BprintMax(new double[ ]{1, 2, 3});
- CprintMax(1, 2, 2, 1, 4);
- DprintMax(new int[ ]{1, 2, 3});
130In the following code, what is the printout for list2?
class Test {
public static void main(String[ ] args) {
int[ ] list1 = {1, 2, 3};
int[ ] list2 = {1, 2, 3};
list2 = list1;
list1[0] = 0; list1[1] = 1; list2[2] = 2;
for (int i = 0; i < list2.length; i++)
System.out.print(list2[i] + " ");
}
}- A0 1 2
- B1 1 1
- C1 2 3
- D0 1 3
131Which of the following errors is synchronous?
- AAll of the above.
- BUnsuccessful memory allocation.
- CArithmetic overflow.
- DDivide by zero.
132When an unchecked exception occurs in a method but is not caught:
- Aall local variables in that method go out of scope.
- Bthe method terminates.
- CAll of the above.
- Dthe method-call stack is unwound.
133What is displayed on the console when running the following program?
class Test {
public static void main(String[ ] args) {
try {
System.out.println("Welcome to Java");
int i = 0;
double y = 2.0 / i;
System.out.println("Welcome to HTML");
}
finally {
System.out.println("The finally clause is executed");
}
}
}- AWelcome to Java.
- BThe program displays three lines: Welcome to Java, Welcome to HTML, The finally clause is executed.
- CNone of the above.
- DWelcome to Java followed by The finally clause is executed in the next line.
134What exception type does the following program throw?
public class Test {
public static void main(String[ ] args) {
String s = "abc";
System.out.println(s.charAt(3));
}
}- AArrayIndexOutOfBoundsException
- BNo exception
- CStringIndexOutOfBoundsException
- DArithmeticException
- EClassCastException
135What is displayed on the console when running the following program?
class Test {
public static void main(String[ ] args) {
try {
System.out.println("Welcome to Java");
int i = 0;
int y = 2/i;
System.out.println("Welcome to Java");
}
catch (RuntimeException ex) {
System.out.println("Welcome to Java");
}
finally {
System.out.println("End of the block");
}
}
}- AThe program displays Welcome to Java three times followed by End of the block.
- BThe program displays Welcome to Java three times.
- CThe program displays Welcome to Java two times.
- DThe program displays Welcome to Java two times followed by End of the block.
136What is displayed on the console when running the following program?
class Test {
public static void main(String[ ] args) {
try {
method();
System.out.println("After the method call");
}
catch (RuntimeException ex) {
System.out.println("RuntimeException");
}
catch (Exception ex) {
System.out.println("Exception");
}
}
static void method() throws Exception {
try {
String s = "5.6";
Integer.parseInt(s); // Cause a NumberFormatException
int i = 0;
int y = 2 / i;
System.out.println("Welcome to Java");
}
catch (NumberFormatException ex) {
System.out.println("NumberFormatException");
throw ex;
}
catch (RuntimeException ex) {
System.out.println("RuntimeException");
}
}
}- AThe program has a compilation error.
- BThe program displays NumberFormatException twice.
- CThe program displays NumberFormatException followed by RuntimeException.
- DThe program displays NumberFormatException followed by After the method call.
137Which of the following statements is false?
- AThe class Throwable provides the method getMessage that returns the descriptive string stored in an exception.
- BThe string returned from class Throwable’s getMessage method contains the name of the exception’s class.
- CThe class Throwable provides the method getStackTrace that outputs the stack trace to the standard error stream.
- DAll exceptions must derive from the class Throwable.
138Analyze the following code:
class Test {
public static void main(String[ ] args) {
try {
int zero = 0;
int y = 2/zero;
try {
String s = "5.6";
Integer.parseInt(s); // Cause a NumberFormatException
}
catch(Exception e) {
}
}
catch(RuntimeException e) {
System.out.println(e);
}
}
}- AThe program has a compilation error because Exception appears before RuntimeException.
- BA try-catch block cannot be embedded inside another try-catch block.
- CA good programming practice is to avoid nesting try-catch blocks, because nesting makes programs difficult to read. You can rewrite the program using only one try-catch block.
- DNone of the above.
139To catch an exception, the code that might throw the exception must be enclosed in a
- Atry block.
- Bcatch block.
- Cthrows block.
- Dfinally block.
140An uncaught exception:
- Ais a possible exception that never actually occurs during the execution of the program.
- Bis an exception that occurs for which the matching catch clause is empty.
- Cis an exception that occurs for which there are no matching catch clauses.
- Dis another term for a thrown exception.
141What exception type does the following program throw?
public class Test {
public static void main(String[ ] args) {
int[ ] list = new int[5];
System.out.println(list[5]);
}
}- AClassCastException
- BArrayIndexOutOfBoundsException
- CNo exception
- DArithmeticException
- EStringIndexOutOfBoundsException
142After a finally block has finished executing (and there are no exceptions to be handled):
- Acontrol returns to the throw point.
- Bthe application exits.
- Ccontrol proceeds to the first statement after the finally block.
- Dcontrol proceeds to the first statement after the last catch block.
143What is displayed on the console when running the following program?
class Test {
public static void main(String[ ] args) {
try {
System.out.println("Welcome to Java");
int i = 0;
int y = 2/i;
System.out.println("Welcome to Java");
}
finally {
System.out.println("End of the block");
}
System.out.println("End of the block");
}
}- AThe program displays Welcome to Java two times followed by End of the block two times.
- BThe program displays Welcome to Java two times followed by End of the block.
- CThe program displays Welcome to Java three times followed by End of the block.
- DThe program displays Welcome to Java and End of the block, and then terminates because of an unhandled exception.
144Which of the following is not included in an exception's stack trace?
- AInstructions on handling the exception.
- BA descriptive message for the exception.
- CThe method-call stack at the time the exception occurred.
- DThe name of the exception.
145Which of the following statements is false?
- AThe finally block and try block can appear in any order.
- BA finally block is placed after the last catch block.
- CA finally block typically releases resources acquired in the corresponding try block.
- DA finally block is optional.
146Attributes of a class are also known as:
- AConstructors.
- BFields.
- CLocal variables.
- DClasses.
147________ is invoked to create an object.
- AA method with the void return type
- BA method with a return type
- CThe main method
- DA constructor
148What type of methods allow a client of a class to assign values to a private instance variable?
- AAssign methods.
- BReplace methods.
- CGet methods.
- DSet methods.
149Which of the following statement is most accurate? (Choose all that apply.)
- AA reference variable refers to an object.
- BAn object may contain the references of other objects.
- CA reference variable is an object.
- DAn object may contain other objects.
150What is the value of myCount.count displayed?
public class Test {
public static void main(String[ ] args) {
Count myCount = new Count();
int times = 0;
for (int i=0; i<100; i++)
increment(myCount, times);
System.out.println(
"myCount.count = " + myCount.count);
System.out.println("times = "+ times);
}
public static void increment(Count c, int times) {
c.count++;
times++;
}
}
class Count {
int count;
Count(int c) {
count = c;
}
Count() {
count = 1;
}
}- A98
- B99
- C100
- D101
151Suppose you wish to provide an accessor method for a boolean property finished, what signature of the method should be?
- Apublic void getFinished()
- Bpublic boolean getFinished()
- Cpublic boolean isFinished()
- Dpublic void isFinished()
152What is the printout of the third println statement in the main method?
public class Foo {
int i;
static int s;
public static void main(String[ ] args) {
Foo f1 = new Foo();
System.out.println("f1.i is " + f1.i + " f1.s is " + f1.s);
Foo f2 = new Foo();
System.out.println("f2.i is " + f2.i + " f2.s is " + f2.s);
Foo f3 = new Foo();
System.out.println("f3.i is " + f3.i + " f3.s is " + f3.s);
}
public Foo() {
i++;
s++;
}
}- Af3.i is 1 f3.s is 1
- Bf3.i is 3 f3.s is 3
- Cf3.i is 3 f3.s is 1
- Df3.i is 1 f3.s is 2
- Ef3.i is 1 f3.s is 3
153Sending a message to an object means that:
- ANeither (a) nor (b).
- BYou access a variable of the object.
- CYou call a method of the object.
- DBoth (a) and (b).
154Analyze the following code and choose the best answer:
public class Foo {
private int x;
public static void main(String[ ] args) {
Foo foo = new Foo();
System.out.println(foo.x);
}
}- ASince x is an instance variable, it cannot be directly used inside a main method. However, it can be accessed through an object such as foo in this code.
- BSince x is private, it cannot be accessed from an object foo.
- CYou cannot create a self-referenced object; that is, foo is created inside the class Foo.
- DSince x is defined in the class Foo, it can be accessed by any method inside the class without using an object. You can write the code to access x without creating an object such as foo in this code.
155Analyze the following code:
public class Test {
public static void main(String[ ] args) {
double radius;
final double PI= 3.15169;
double area = radius * radius * PI;
System.out.println("Area is " + area);
}
}- AThe program has compile errors because the variable radius is not initialized.
- BThe program compiles and runs fine.
- CThe program has no compile errors but will get a runtime error because radius is not initialized.
- DThe program has a compile error because a constant PI is defined inside a method.
156Analyze the following code:
public class Test {
private int t;
public static void main(String[ ] args) {
int x;
System.out.println(t);
}
}- AThe program compiles and runs fine.
- Bt is non-static and it cannot be referenced in a static context in the main method.
- CThe variable x is not initialized and therefore causes errors.
- DThe variable t is private and therefore cannot be accessed in the main method.
- EThe variable t is not initialized and therefore causes errors.
157Analyze the following code:
public class Test {
public static void main(String args[ ]) {
NClass nc = new NClass();
nc.t = nc.t++;
}
}
class NClass {
int t;
private NClass() {
}
}- AThe program has a compilation error because the NClass class has a private constructor.
- BThe program compiles and runs fine.
- CThe program does not compile because the parameter list of the main method is wrong.
- DThe program compiles, but has a runtime error because t has no initial value.
158A method that is associated with an individual object is called ________.
- Aan object method
- Ba static method
- Ca class method
- Dan instance method
159When invoking a method with an object argument, ________ is passed.
- Athe contents of the object
- Ba copy of the object
- Cthe reference of the object
- Dthe object is copied, then the reference of the copied object
160Which of the following statements are true? (Choose all that apply.)
- AUse the private modifier to encapsulate data fields.
- BEncapsulating data fields helps prevent programming errors.
- CEncapsulating data fields makes the program easy to maintain.
- DEncapsulating data fields makes the program short.
161What is the printout for the first statement in the main method?
public class Foo {
static int i = 0;
static int j = 0;
public static void main(String[ ] args) {
int i = 2;
int k = 3;
{
int j = 3;
System.out.println("i + j is " + i + j);
}
k = i + j;
System.out.println("k is " + k);
System.out.println("j is " + j);
}
}- Ai + j is 23
- Bi + j is 22
- Ci + j is 5
- Di + j is 6
162In the UML, a class's attributes are placed in the ________ compartment of the class's rectangle.
- Athird
- Bsecond
- Cbottom
- Dfirst
163You can declare two variables with the same name in ________.
- Adifferent methods in a class
- Ba method one as a formal parameter and the other as a local variable
- Ctwo nested blocks in a method (two nested blocks means one being inside the other)
- Da block
164We can derive many of the operations of each class by examining the key ________ and ________ in the requirements documents.
- Anouns. noun phrases.
- Bobjectives, objective phrases.
- Cverbs, verb phrases.
- DBoth a and b.
165The sequence of messages in a communication diagram progresses:
- Aalphabetically.
- BNone of the above.
- Cin numerical order from least to greatest.
- DBoth of the above.
166Objects are modeled in the UML as         containing names in the form         .
- Arectangles, : ClassName.
- Brectangles, objectName : ClassName.
- Covals, objectName : ClassName.
- Dovals, : ClassName.
167In the UML, the         diagram emphasizes which objects participate in collaborations.
- Acollaboration.
- Bparticipation.
- Csequence.
- Dcommunication.
168UML ________ model several states of an object and show under what circumstances the object changes state.
- Adiagrams.
- Bstate machine diagrams.
- Cmachine diagrams.
- Dactivity diagrams.
169What is the printout for the second statement in the main method?
public class Foo {
static int i = 0;
static int j = 0;
public static void main(String[ ] args) {
int i = 2;
int k = 3;
{
int j = 3;
System.out.println("i + j is " + i + j);
}
k = i + j;
System.out.println("k is " + k);
System.out.println("j is " + j);
}
}- Ak is 0
- Bk is 1
- Ck is 3
- Dk is 2
170Which diagram is also called a collaboration diagram.
- AState machine diagram.
- BSequence diagram.
- CActivity diagram.
- DCommunication diagram.
171Analyze the following code: (Choose all that apply.)
class Test {
private double i;
public Test(double i) {
this.t();
this.i = i;
}
public Test() {
System.out.println("Default constructor");
this(1);
}
public void t() {
System.out.println("Invoking t");
}
}- Athis(1) must be replaced by this(1.0).
- Bthis.i may be replaced by i.
- Cthis(1) must be called before System.out.println("Default constructor").
- Dthis.t() may be replaced by t().
172What is a message between collaborating objects called in the UML?
- Acommunication call.
- Bcollaboration call.
- Csynchronous call.
- Dasynchronous call.
173Communication diagrams contain an object's lifeline. Which of the following is true of the object's lifeline?
- AActions occur along an object's lifeline in chronological order from top to bottom.
- BThe lifeline represents the progression of time.
- CAll of the above are true.
- DThe line is dotted.
174An activation indicates that:
- Aan object is sending a message.
- Ban object is being created.
- Can object has completed executing.
- Dan object is executing.
175The use case diagram models ________.
- Aeach software life cycle by repeating one or more stages several times via use cases.
- Beach software life cycle stage in succession.
- Cthe interactions between implementations and testing.
- Dthe interactions between a system's client and one of the system's capabilities.
176Which of the following statements are true? (Choose all that apply.)
- ADynamic binding can apply to static methods.
- BThe compiler finds a matching method according to parameter type, number of parameters, and order of the parameters at compilation time.
- CA method may be implemented in several subclasses. The Java Virtual Machine dynamically binds the implementation of the method at runtime.
- DYou can always pass an instance of a subclass to a parameter of its superclass type. This feature is known as polymorphism.
- EDynamic binding can apply to instance methods.
177Which method changes the text the label displays?
- AchangeText.
- BchangeLabel.
- CsetLabel.
- DsetText.
178Composition means ________.
- Athat a class can extend another class
- Bthat a variable of supertype can refer to a subtype object
- Cthat data fields should be declared private
- Dthat a class can contain another class
179Every object in Java knows its own class and can access this information through method ___________________ .
- AgetClass.
- BobjectInformation.
- CgetInformation.
- DobjectClass.
180Analyze the following code: (Choose all that apply.)
import java.util.StringTokenizer;
public class A extends StringTokenizer {
}- AThe program would compile fine if you add the following constructor into A: A(String s) { super(s); }
- BThe program has a compilation error because A does not have a default constructor.
- CThe program would compile fine if you add the following constructor into A: A(String s) { }
- DThe program has a compilation error because the default constructor of A invokes the default constructor of StringTokenizer, but StringTokenizer does not have a default constructor.
181The default implementation of method clone of Object performs a ________.
- Afull copy.
- Bshallow copy.
- Cempty copy.
- Ddeep copy.
182Analyze the following code:
public class Test {
public static void main(String[ ] args) {
String s = new String("Welcome to Java");
Object o = s;
String d = (String)o;
}
}- AWhen casting o to s in String d = (String)o, a new object is created.
- BWhen assigning s to o in Object o = s, a new object is created.
- CWhen casting o to s in String d = (String)o, the contents of o is changed.
- Ds, o, and d reference the same String object.
183Inheritance is also known as the
- A"is-a" relationship.
- B"knows-a" relationship.
- C"uses-a" relationship.
- D"has-a" relationship.
184Polymorphism enables you to:
- Aprogram in the general.
- Bhide information from the user.
- Cprogram in the specific.
- Dabsorb attributes and behavior from previous classes.
185Which of the following statements are true? (Choose all that apply.)
- A"class A extends B" means B is a subclass of A.
- B"class A extends B" means A is a subclass of B.
- CA subclass is a subset of a superclass.
- DA subclass is usually extended to contain more functions and more detailed information than its superclass.
186Classes and methods are declared final for all but the following reasons:
- Afinal methods allow inlining the code.
- Bfinal methods can improve performance.
- Cfinal methods are static.
- Dfinal methods and classes prevent further inheritance.
187When a superclass variable refers to a subclass object and a method is called on that object, the proper implementation is determined at execution time. What is the process of determining the correct method to call?
- Aexecution binding.
- Bexecution time binding.
- Cjust-in-time binding.
- Dlate binding.
188Which of the following is the superclass constructor call syntax?
- Akeyword super, followed by a dot (.) .
- Bkeyword super, followed by a dot and the superclass constructor name.
- CNone of the above.
- Dkeyword super, followed by a set of parentheses containing the superclass constructor arguments.
189Which of the statements regarding the super keyword is incorrect?
- AYou can use super to invoke a super class method.
- BYou can use super to invoke a super class constructor.
- CYou can use super.super.p to invoke a method in superclass's parent class.
- DYou cannot invoke a method in superclass's parent class.
190Which statement best describes the relationship between superclass and subclass types?
- AA subclass reference can be assigned to a superclass variable, but a superclass reference cannot be assigned to a subclass variable.
- BA superclass reference can be assigned to a subclass variable, but a subclass reference cannot be assigned to a superclass variable.
- CA subclass reference can be assigned to a superclass variable and a superclass reference can be assigned to a subclass variable.
- DA subclass reference cannot be assigned to a superclass variable and a superclass reference cannot be assigned to a subclass variable.
191A Java character is stored in ________.
- Atwo bytes
- Bfour bytes
- Cone byte
- Dthree bytes
192Which statement is false?
- AUnless directed otherwise, the computer executes Java statements one after the other in the order in which they are written.
- BActivity diagrams normally show the Java code that implements the activity.
- CLike pseudocode, activity diagrams help programmers develop and represent algorithms.
- DThe arrows in the activity diagram represent transitions, which indicate the order in which the actions represented by the action states occur.
193Keyword ________ indicates the inheritance relationship.
- Aextends
- Binherits
- Csuper
- Dparent
194What is the result value of c at the end of the following code segment?
int c = 8;
c++;
++c;
c %= 5;- A0.
- B1.
- C3.
- DNone of the above.
195Which statement is false?
- ATo ensure that the operands are of the same type, Java performs implicit conversion on selected operands.
- BCast operators are unary operators.
- CCast operators associate from right to left and are one level lower in precedence than the multiplicative operators.
- DCast operators are formed by placing parentheses around the name of a type.
196Which of the following would not be used to clarify a dangling-else?
- AIndentation.
- BParentheses ().
- CBraces {}.
- DComment //.
197To assign a double variable d to a float variable x, you write
- Ax = (long)d
- Bx = d;
- Cx = (float)d;
- Dx = (int)d;
198Suppose i is an int type variable. Which of the following statements display the character whose Unicode is stored in variable i?
- ASystem.out.println(i);
- BSystem.out.println(i + " ");
- CSystem.out.println((int)i);
- DSystem.out.println((char)i);
199What is the number of iterations in the following loop:
for (int i = 1; i < n; i++) {
// iteration
}- An - 1
- Bn
- Cn + 1
- D2*n
200Consider the following Java statements:
int x = 9;
double y = 5.3;
result = calculateValue( x, y );- AA method is called with its name and parentheses.
- Bx and y are parameters.
- CCopies of x and y are passed to the method calculateValue().
- Dx and y are arguments.
Información
- Descripción
- A practice test for Gwinnett Tech's Level 1 java class
- Autor
- Ummm No
- Idioma
- English
- Visitas
- 1.620
- Etiquetas
- Valoración
- 3,3 de 5 · 3 valoraciones Valora este test