Question
11. What does the following statement sequence print? final String str = Java; str += is powerful; System.out.println(str); Select one: a. Java is powerful
11.
What does the following statement sequence print?
final String str = "Java";
str += " is powerful";
System.out.println(str);
Select one:
a. Java is powerful
b. Java + is powerful
c. is powerful
d. Nothing; compile-time error
12.
During program development, errors are
Select one:
a. very rare
b. prevented by the compiler
c. automatically tracked by the Integrated Development Environment (IDE)
d. unavoidable
13.
Java 7 introduced enhanced syntax for declaring array lists, which is termed
Select one:
a. angle brackets.
b. method lists.
c. diamond syntax.
d. symmetric slants.
14.
Consider the following code snippet. What is the potential problem with the if
statement?
double average;
average = (g1 + g2 + g3 + g4) / 4.0;
if (average == 90.0)
{
System.out.println("You earned an A in the class!");
}
Select one:
a. Using == to test the double variable average for equality is error-prone.
b. The conditional will not evaluate to a Boolean value.
c. The assignment operator should not be used within an if-statement
conditional.
d. Literals should never be used in if statement conditionals.
15.
Computer scientists have devised something that allows programmers to describe
tasks in words that are closer to the syntax of the problems being solved. This is
called a(n)
Select one:
a. Embedded system
b. Machine instruction
c. High-level programming language
d. Compiler
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started