Final Exam Study Guide With 100%
Correct Answers | Verified
(Quiz 0) Which of the following is true?
a) Java applications can run on different platforms, like Windows and Unix, without
being recompiled.
b) C++ applications have always run more slowly than Java applications . , In contrast
to Java
c) C# requires programmers to manage almost all memory operations.
d) All of the those answers. CORRECT ANSWERS a) Java applications can run on
different platforms, like Windows and Unix, without being recompiled.
(Quiz 0) Which of the following is not a benefit of using an IDE?
a) The syntax of your code is checked as you enter it.
b) The debugging features make it easier for you to find bugs in your applications
c) The IDE helps you complete code as you type
d) Your code compiles and runs faster. CORRECT ANSWERS d) Your code compiles
and runs faster.
(Quiz 0) The extension for a Java source file is
a) txt
b) Class
c) Java
d) Jav CORRECT ANSWERS c) Java
(Quiz 0) You typically use comments in a Java application to
a) describe statements that are difficult to understand
b) separate blocks of code
c) provide user instructions
d) None of the above CORRECT ANSWERS a) describe statements that are difficult to
understand
(Quiz 0) Which of the following is a valid variable name?
a) salesTax
b) input-string
c) 25Percent
d) double CORRECT ANSWERS a) salesTax
(Quiz 0) According to standard naming conventions, which of the following is a typical
class name?
a) $Calculate
b) calculateTotal
, c) Product
d) product CORRECT ANSWERS c) Product
(Quiz 0) Which of the following is a valid statement for declaring and initializing a double
variable named length to a starting value of 120?
a) length = 120.0;
b) Double length = 120.0;
c) double length = 120.0;
d) double length = 120.0 CORRECT ANSWERS c) double length = 120.0;
(Quiz 0) Which of the following can you assign to a String variable?
a) an empty string
b) null
c) a string literal
d) all of the above CORRECT ANSWERS d) all of the above
(Quiz 0) If a class contains a main method, that method is executed
a) when the class is run
b) when another method within the class calls it
c) when an object is created from the class
d) none of the above CORRECT ANSWERS a) when the class is run
(Quiz 0) You use an escape sequence to
a) indicate the beginning of a literal string
b) include a special character in a string
c) indicate the beginning of a comment
d) append a string expression to a string variable CORRECT ANSWERS b) include a
special character in a string
(Quiz 0) What does the following statement do in a Java application?
import java.util.Scanner;
a) It makes the Scanner class available to the application without qualification.
b) It makes the classes of the Scanner package available to the application
c) It copies user entries into the main method of the application.
d) It looks for syntax errors in the application. CORRECT ANSWERS a) It makes the
Scanner class available to the application without qualification.
(Quiz 0) You can use relational operators to
a) compare string variables
b) compare numeric variables
c) both a and b
d) neither a nor b CORRECT ANSWERS b) compare numeric variables
(Quiz 0) Unlike regular methods, a static method
a) is called directly from a class
b) is stored in a class that can't be instantiated