Exam 5: Writing Classes
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
A _______________ variable is shared among all instances of a class.
(Multiple Choice)
4.9/5
(37)
When applied to instance variables, the ________________ visibility modifier enforces encapsulation.
(Multiple Choice)
4.9/5
(45)
Write a method called threeOfAKind that takes in three integer parameters and returns true if all three of them are the same, false otherwise.
(Short Answer)
4.9/5
(43)
If a service is so complex that it cannot be reasonably be implemented using one method, it is often helpful to decompose it to make use of ________________ support methods.
(Multiple Choice)
4.8/5
(44)
Variables that are declared as static are shared among all instances of a class.
(True/False)
5.0/5
(46)
The ________________ reference always refers to the currently executing object.
(Multiple Choice)
4.8/5
(35)
A ________________ diagram helps us visualize the contents of and relationships among the classes of a program.
(Multiple Choice)
4.9/5
(27)
A programmer is required to define a constructor for every class.
(True/False)
4.7/5
(36)
Explain the difference between actual parameters and formal parameters.
(Essay)
4.8/5
(39)
Write a method that prints your name, age, and major. The method should accept no parameters and return no value.
(Short Answer)
4.8/5
(32)
Write a method called containsPair that takes in three integer parameters and returns true if any two of the input parameters are the same.
(Short Answer)
4.7/5
(43)
Which of the following method headers is most likely a header for a mutator method?
(Multiple Choice)
4.9/5
(39)
A(n) ___________________ object is one that is made up, at least in part, of other objects.
(Multiple Choice)
4.9/5
(30)
Write a method called square that takes in an integer value and returns the integer squared. Your method should use the Math.pow() method.
(Short Answer)
5.0/5
(34)
Write a method called isPalindrome that accepts a String as a parameter and returns true if the String is a palindrome, and false otherwise. You may assume that the entered String consists entirely of lowercase letters (meaning it contains no numbers, spaces, punctuation, etc). Hint: write code that creates a new string that is the original string reversed, and then check to see if the two strings are equal.
(Short Answer)
4.8/5
(37)
The versions of an overloaded method are distinguished by ___________________________.
(Multiple Choice)
4.8/5
(33)
Showing 21 - 40 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)