Question: 7. A combination lock has the following basic properties: the combination (a sequence of three numbers) is hidden; the lock can be opened by providing

 7. A combination lock has the following basic properties: the combination

7. A combination lock has the following basic properties: the combination (a sequence of three numbers) is hidden; the lock can be opened by providing the combination; and the combination can be changed, but only by someone who knows the current combination. Design a class with public methods open and changeCombo and private data fields that store the combination. The combination should be set in the constructor. Do not compile and run your code, just provide a paper copy 8. What is the difference between a final class and other classes? Why are final classes used? 9. What is an interface? How does the interface differ from an abstract class? What members may be in an interface? 10. (a) Suppose a List listl has elements "A", "B", "C", and "D". What is returned by: 1. list 1 iterator),.next0; 2. list 1.listIterator().nextO 3. list1.listlterator(2).next0 4. list1.listIterator(4).previous() (b) Say what is deleted (or what happens) if next/previous is replaced by remove in all of the above operations. Explain. (c) If we had the following sequence of commands list 1.listIterator(2).next(;list1.listIterator(2) remove); list 1.listIterator(4).previous what would be returned? What would the list look like following these operations

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!