<< Chapter < Page | Chapter >> Page > |
True or False? A TreeSet object can contain duplicate elements.
True or False? A TreeSet object is not a SortedSet.
True or False? A TreeSet object is a Collection.
True or False? Because an object of the TreeSet class is a Collection , a reference to such an object can be passed to any method that requires an incoming parameter of type Collection . The receiving method can call any method on that reference that is declared in the Collection interface .
True or False? The behavior of the fillIt method in Listing 1 is to add elements to the incoming Collection object without regard for the actual type of the object (the class from which the object was instantiated).
True or False? In Listing 1 , a reference to an object of type Button (see the Java documentation) could be passed as a parameter to the fillIt method.
True or False? In Listing 1 , the fillIt method can call the add method on the incoming object with confidence that the behavior of the add method will be appropriate for the specific type of object involved.
True or False? In Listing 1 , when the fillIt method returns, the TreeSet object contains five elements.
True or False? In Listing 1 , when the fillIt method returns, the TreeSet object contains four (not five) elements with no duplicates. Each element is a reference to an object of type Integer . Those references are maintained in such a way as to make them accessible in descending order, basedon the int values encapsulated in each of the Integer objects.
True or False? The call to the iterator method on any Collection object returns an instance of a class that implements the Iterator interface.
True or False? An Iterator object can be used to traverse a Collection object, gaining access to each element in order .
True or False? The concept of in order means the same thing for all Collection objects.
True or False?
The Iterator interface declares three methods:
True or False? The Iterator object associated with a particular Collection object provides access to the contents of the collection in a very specific way.
True or False? The while loop in the Worker class in Listing 1 traverses the collection
True or False? Listing 1 causes the following text to appear on the screen:
44321
What is the meaning of the following two images?
These images were inserted here simply to insert some space between the questions and the answers to keep them from being visible on the screen at thesame time.
This image was also inserted for the purpose of inserting space between the questions and the answers.
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?