Exam 3: Using Classes and Objects
Exam 1: Introduction40 Questions
Exam 2: Data and Expressions40 Questions
Exam 3: Using Classes and Objects40 Questions
Exam 4: Conditionals and Loops40 Questions
Exam 5: Writing Classes40 Questions
Exam 6: Graphical User Interfaces40 Questions
Exam 7: Arrays40 Questions
Exam 8: Inheritance40 Questions
Exam 9: Polymorphism39 Questions
Exam 11: Recursion40 Questions
Exam 10: Exceptions40 Questions
Exam 12: Searching and Sorting40 Questions
Exam 13: Trees40 Questions
Exam 14: Introduction to Collections and Stacks40 Questions
Exam 15: Heaps and Priority Queues40 Questions
Exam 16: Graphs40 Questions
Select questions type
Which of the following expressions correctly compute 5 + 26?
Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
D
When two references point to the same object, ________________________________ .
Free
(Multiple Choice)
4.9/5
(38)
Correct Answer:
C
A special method that is invoked to set up an object during instantiation is called a ___________________.
Free
(Multiple Choice)
4.8/5
(36)
Correct Answer:
D
When an object variable is declared but it is not assigned a value, it is called a ______________________.
(Multiple Choice)
4.9/5
(41)
The ________________ operator is used to instantiate an object.
(Multiple Choice)
4.8/5
(38)
Which of the following is an invalid way to instantiate a String object?
(Multiple Choice)
4.7/5
(41)
Write a single line that creates a wrapper for an int variable num.
(Short Answer)
4.7/5
(33)
Suppose we have a String object called myString. Write a single line of Java code that will output myString in such a way that all of its characters are uppercase.
(Short Answer)
4.8/5
(31)
Which of the following is a correct declaration of enumerated type for the suits of a deck of cards?
(Multiple Choice)
4.8/5
(50)
Assume that we have a Random object referenced by a variable called generator. Which of the following lines will generate a random number in the range 5-20 and store it in the int variable randNum?
(Multiple Choice)
4.9/5
(37)
Write an expression that will compute the length of the tangent of a right triangle, given one of the non-right angles. You may assume that this value is stored in a variable called angle.
(Short Answer)
4.9/5
(33)
Explain how variables representing objects and variables representing primitive types are different.
(Essay)
4.9/5
(39)
Write a short program that allows the user to input a positive integer and then outputs a randomly generated integer between 1 and the input number.
(Essay)
4.9/5
(38)
All of the classes contained in the java.util package are automatically included in every Java program.
(True/False)
4.9/5
(40)
Enumerated types allow a programmer to treat primitive data as objects.
(True/False)
4.9/5
(37)
Write a short program that asks the user to input a string, and then outputs the number of characters in the string.
(Essay)
5.0/5
(33)
Explain what it means for a String object to be immutable. Are there any workarounds for this?
(Essay)
4.8/5
(36)
A variable that is declared as a primitive type stores the actual value of the associated data. A variable that is declared as an object type stores a pointer to the associated object.
(True/False)
4.8/5
(39)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)