Exam 2: Using Data
Exam 1: Creating Java Programs68 Questions
Exam 2: Using Data74 Questions
Exam 3: Using Methods, Classes, and Objects68 Questions
Exam 4: More Object Concepts67 Questions
Exam 5: Making Decisions70 Questions
Exam 6: Looping72 Questions
Exam 7: Characters, Strings, and the Stringbuilder73 Questions
Exam 8: Arrays74 Questions
Exam 9: Advanced Array Concepts74 Questions
Exam 10: Introduction to Inheritance70 Questions
Exam 11: Advanced Inheritance Concepts70 Questions
Exam 12: Exception Handling65 Questions
Exam 13: File Input and Output74 Questions
Exam 14: Introduction to Swing Components74 Questions
Exam 15: Advanced Gui Topics69 Questions
Exam 16: Graphics74 Questions
Exam 17: Applets, Images, and Sound72 Questions
Select questions type
Describe the error message that will be produced when the following code is compiled.
public class SalesOct
{
public static void main(String[] args)
{
int salesAmt;
System.out.print("October sales are $");
System.out.println(salesAmt);
}
}
(Essay)
4.9/5
(73)
public class EndValue
{
public static void main(String[] args)
{
int aByte = 940;
System.out.print("The ending value is "+ aByte);
}
}
When the above code is compiled, what error message will be generated and why?
(Essay)
4.9/5
(72)
char aCharacter = 2;
int aNumber = '2';
In the above statements, what values will be output after a println() statement is executed? Why are the output results different for the two statements?
(Essay)
4.7/5
(70)
When you write programs that accept ____________________, there is a risk that the user will enter the wrong type of data.
(Short Answer)
4.9/5
(90)
What is the difference between the float data type and the double data type?
(Essay)
4.7/5
(70)
Primitive types serve as the building blocks for more complex data types, called ____ types.
(Multiple Choice)
4.9/5
(80)
Describe how to assign values based on the result of comparisons to Boolean variables.
(Essay)
4.7/5
(94)
Why is the following relational operator expression invalid? How could you rewrite the statement so that it is valid?
boolean isGradePassing = (grade => 70);
(Essay)
4.9/5
(76)
The term ____ refers to the mathematical accuracy of a value.
(Multiple Choice)
4.8/5
(75)
How could you alter the following statement to display "Welcome" on one line and "back" on another line?
System.out.println("Welcome back");
(Essay)
4.9/5
(70)
Even if a statement occupies multiple lines, the statement is not complete until the semicolon is reached.
(True/False)
4.8/5
(79)
In Java, ____ is a built-in class that provides you with the means for storing and manipulating character strings.
(Multiple Choice)
4.9/5
(81)
Write the statement to declare an uninitialized integer value for salesAmt.
(Essay)
4.7/5
(78)
MATCHING
Match each term with the correct statement below.
-A floating-point data type
(Multiple Choice)
4.9/5
(76)
MATCHING
Match each term with the correct statement below.
-The operator that is represented by an equal sign (=)
(Multiple Choice)
4.9/5
(74)
Showing 41 - 60 of 74
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)