<< Chapter < Page Chapter >> Page >

Spacer image of a penguin and some houses.

Answers

Answer 25

False. Listing 1 causes the following text to appear on the screen:

1234

Back to Question 25

Answer 24

True.

Back to Question 24

Answer 23

True.

Back to Question 23

Answer 22

True.

Back to Question 22

Answer 21

False. The concept of in order means different things for different Collection objects. For a collection instantiated from the TreeSet class, for example, in order means in ascending order. However, that may not be the case for a differentobject instantiated from a class that implements the Collection interface.

Back to Question 21

Answer 20

True.

Back to Question 20

Answer 19

True.

Back to Question 19

Answer 18

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 ascending order, based on the int values encapsulated in each of the Integer objects.

Back to Question 18

Answer 17

False. In Listing 1 , when the fillIt method returns, the TreeSet object contains four (not five) elements with no duplicates.

Back to Question 17

Answer 16

True. For example, the behavior of the add method for an object of the TreeSet class will probably be different from the behavior ofthe add method for an object of some other class that implements the Collection interface.

Back to Question 16

Answer 15

False. The fillIt method receives the reference as type Collection . This method doesn't know, and doesn't care, what the actual type of the object is. All it cares about is that the object is a Collection object. (Otherwise, the object's reference couldn't be passed in as a parameter. A type mismatch would occur.) A TreeSet object is a Collection because the TreeSet class implements the Collection interface. A Button object is not a Collection because the Button class does not implement the Collection interface.

Back to Question 15

Answer 14

True.

Back to Question 14

Answer 13

True.

Back to Question 13

Answer 12

True.

Back to Question 12

Answer 11

False. The TreeSet class implements the SortedSet interface. This guarantees that the contents of a TreeSet object will be in ascending element order, regardless of the order in which the elements areadded.

Back to Question 11

Answer 10

False. An object of the TreeSet class also is a Set . One of the characteristics of a Java Set (an object that implements the Set interface) is that it can contain no duplicate elements. Therefore, a TreeSet object can contain no duplicate elements.

Back to Question 10

Answer 9

True.

Back to Question 9

Answer 8

True.

Back to Question 8

Answer 7

False. a TreeSet object is a Collection . Therefore, a reference to a TreeSet object can be stored in a reference variable of type Collection , and can be treated as the generic type Collection .

Back to Question 7

Answer 6

True.

Back to Question 6

Answer 5

False. Listing 1 instantiates an object of the TreeSet class and stores the object's reference in a reference variable of type Collection named ref .

Back to Question 5

Answer 4

True.

Back to Question 4

Answer 3

False. Some collections are ordered and others are not.

Back to Question 3

Answer 2

True.

Back to Question 2

Answer 1

False. The framework is designed to encourage you to reuse rather than to reinvent collections and maps.

Back to Question 1

Miscellaneous

This section contains a variety of miscellaneous information.

Housekeeping material
  • Module name: Java4010r Review: Java4010: Getting Started with Java Collections
  • File: Java4010r.htm
  • Published: 11/24/13
Disclaimers:

Financial : Although the Connexions site makes it possible for you to download aPDF file for this module at no charge, and also makes it possible for you to purchase a pre-printed version of the PDF file, youshould be aware that some of the HTML elements in this module may not translate well into PDF.

I also want you to know that, I receive no financial compensation from the Connexions website even if you purchase the PDF version ofthe module.

In the past, unknown individuals have copied my modules from cnx.org, converted them to Kindle books, and placed them for sale onAmazon.com showing me as the author. I neither receive compensation for those sales nor do I know who does receive compensation. If youpurchase such a book, please be aware that it is a copy of a module that is freely available on cnx.org and that it was made andpublished without my prior knowledge.

Affiliation : I am a professor of Computer Information Technology at Austin Community College in Austin, TX.

-end-

Questions & Answers

why should a firm close down when it's unable to pay it's variable cost?
ANDREW Reply
what is oligopolistic competitive market?
ngong
exchange of goods and services between countries is call
Hosea Reply
foreign trade
Peace
what is constant opportunity cost
Tiffany Reply
Constant opportunity cost means the value of sacrifice remains constant in every step.
Dipam
Gross Domestic Product GDP
Yusuf Reply
what is g d p
Jayapal Reply
gross daily performance
domingo
How best can a poor country respond to an economic crisis , what does it have to sacrifice.
Bah Reply
they should pay tax as progressive system and should make sacrifice for taxation of their income and land etc
Hamza
how have the nations tries to solve the problem of scarcity in their economies?
Amani Reply
total concentration on to reduce the per unit cost of commodity by technically or whatever
Hamza
explain what will happen to producer of green coconut now that we have to lockdown in the kingdom of tonga
Tuha Reply
the demand for coconut will decrease and supply increases which result in the decrease in the price of coconut and the coconut will be more elastic
Hamza
tonga is producing more long run economic good explain the meaning of the statement and its implication on the tonga economy
Tuha Reply
Demand is the various quantities of goods and services that consumer(s)are willing and able to purchase at a price within a time
Muhammad Reply
What is demand
Mc Reply
demand relates with the need of people for their satisfaction.
Mohd
demand is de amount of goods and services a consumer us willing to purchase at a given price over a given period of time
Osei
riDemand is the amount of good and services which consumers are willing and able to buy at a particular peroid of time and at a given price
Miguel
Yes that is the tire thing
samuel
Demand is the quantity of goods and services which consumers are willing and able to purchase at a given price over a period of time
Sundaybha
simply , Demand is the sum up of 1)- desire of the commodity 2)- purchasing power for that commodity
Hamza
demand is the amount of goods and service wen consumers are willing and able to buy them at a give time
Dora
Distinguish between cross elasticity and income elasticity of demand
Ruth Reply
Distinguish between cross elasticity and income elasticity of demand
Ruth
if change in the demand of the commodity with respect to change in demand of the substitute or other product called cross elasticity
Hamza
and. if change in the demand of the commodity due to change in the income . called income elasticity
Hamza
👍
Vipul
Cross elasticity of demand is the degree of responsiveness of quantity demanded of a commodity to a small change in price of another commodity whiles Income elasticity of demand is the degree of responsiveness of quantity demanded of a commodity to a small change in income of it's consumers
Afriyie
but these are book wordings
Hamza
income elasticity of demand shows how quantity demanded changes due to changes in income on the other hand cross elasticity refers to how the quantity demanded of a particular good alers given a change in the price of another good.
Keysie
what is the competitive demand
Adiza Reply
Income
Sanni
Competitive demand are those commodity dat are competitive in nature e.g the close up and my my toothpaste the increase in price of close up may bring abt decrease in demand of it and it will serve as increase in purchase of my my
Daniel
With regards to coal shortage and manicipal debts the what form of intervention do you think Eskom can put in place.
kedibone Reply
economic growth of Bhutan
Nima Reply
please, explain all the mathematics terms used in economics
nelson
The answer is: little more than high school algebra and graphs.
Tere
While the American heart association suggests that meditation might be used in conjunction with more traditional treatments as a way to manage hypertension
Beverly Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!





Source:  OpenStax, Object-oriented programming (oop) with java. OpenStax CNX. Jun 29, 2016 Download for free at https://legacy.cnx.org/content/col11441/1.201
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?

Ask