<< Chapter < Page Chapter >> Page >

Answer 12

Question 13

True or False? The Java documentation describes the general behavior that must be exhibited by each of the methods belonging to an object instantiated from a class that implements the Collection interface. This is sometimes referred to as a contract .

Answer 13

Question 14

True or False? If you define a class that implements the Collection interface in a manner consistent with the Collections Framework , you need not make certain that each of your methods behaves as described in theOracle documentation.

Answer 14

Question 15

True or False? A contract in the Collections Framework defines the behavior of declared methods in a very general way. There is noindication as to how that behavior is to be achieved.

Answer 15

Question 16

True or False? According to a contract of the Set interface, objects that implement the Set interface are allowed to contain duplicate elements.

Answer 16

Question 17

True or False? According to a contract of the Collection interface, objects that implement the Collection are never allowed to contain duplicate elements.

Answer 17

Question 18

True or False? The contract for the add method declared in the List interface, (which extends Collection) , does not prohibit duplicate elements.

Answer 18

Question 19

True or False? The List interface contract prohibits duplicate elements while the Set interface contract does not prohibit duplicate elements.

Answer 19

Question 20

True or False? The classes in the following list are concrete implementation classes in the Java Collections Framework:

  • HashSet
  • TreeSet
  • LinkedList
  • Vector
  • ArrayList
  • HashMap
  • Hashtable
  • WeakHashMap
  • TreeMap

Answer 20

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.

Spacer image of a rabbit and a penguin.

This image was also inserted for the purpose of inserting space between the questions and the answers.

Spacer image of a penguin and some houses.

Answers

Answer 20

True.

Back to Question 20

Answer 19

False. The Set interface contract prohibits duplicate elements while the List interface contract does not prohibit duplicate elements.

Back to Question 19

Answer 18

True.

Back to Question 18

Answer 17

False. The contract for the add method, as declared in the Collection interface, does not prohibit duplicate elements, but does make the provision for interfaces that extend Collection to prohibit duplicate elements. The contract for the add method in the Set interface does prohibit duplicate elements.

Back to Question 17

Answer 16

False. According to a contract of the Set interface, objects that implement the Set interface never contain duplicate elements.

Back to Question 16

Answer 15

True.

Back to Question 15

Answer 14

False. If you define a class that implements the Collection interface in a manner consistent with the Collections Framework , you must make certain that each of your methods behaves as described in the Oracledocumentation. In other words, you must be careful to comply with the contract defined for those methods. If you don't do that, a user can't rely on objects instantiated from your class to exhibit proper behavior.

Back to Question 14

Answer 13

True.

Back to Question 13

Answer 12

True.

Back to Question 12

Answer 11

False. there is no technical requirement for a specification of the behavior of the interface methods when implemented in a class. In fact, because a methodthat is declared in an interface is abstract, it specifically refrains from defining the behavior of the method. The interface definition simply declaresthe interfaces for all the methods that it declares.

Back to Question 11

Answer 10

True.

Back to Question 10

Answer 9

True.

Back to Question 9

Answer 8

False. An object in Java can often be considered to be of several different types. One of those types is determined by any interfaces implemented by theclass from which the object was instantiated.

Back to Question 8

Answer 7

True.

Back to Question 7

Answer 6

True.

Back to Question 6

Answer 5

True.

Back to Question 5

Answer 4

False.

At least three things are included in a collections framework:

  • interfaces
  • implementations
  • algorithms

Variables are not necessarily one of those things.

Back to Question 4

Answer 3

False.

Back to Question 3

Answer 2

True.

Back to Question 2

Answer 1

True.

Back to Question 1

Miscellaneous

This section contains a variety of miscellaneous information.

Housekeeping material
  • Module name: Java4030r Review
  • File: Java4030r.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

what are the importance of studying economics
Bherla Reply
To know if the country is growing or not through the country's GDP
Ariel
What is the law of demand
Yaw Reply
price increase demand decrease...price decrease demand increase
Mujahid
ıf the price increase the demand decrease and if the demand increase the price decrease
MUBARAK
all other things being equal, an increase in demand causes a decrease in supply and vice versa
SETHUAH
yah
Johnson
how is the economy of usa now
Johnson
What is demand
jude Reply
Demand is the quantity of goods and services a consumer is willing and able to purchase at various prices over a given period of time.
Yaw
yea
SETHUAH
Okay congratulations I'll join you guys later .
Aj
yes
MUBARAK
calculate elasticity of income exercises
HABANABAKIZE Reply
If potatoes cost Jane $1 per kilogram and she has $5 that could possibly spend on potatoes or other items. If she feels that the first kilogram of potatoes is worth $1.50, the second kilogram is worth$1.14, the third is worth $1.05 and subsequent kilograms are worth $0.30, how many kilograms of potatoes will she purchase? What if she only had $2 to spend?
Susan Reply
cause of poverty in urban
DAVY Reply
QI: (A) Asume the following cost data are for a purely competitive producer: At a product price Of $56. will this firm produce in the short run? Why Why not? If it is preferable to produce, what will be the profit-maximizing Or loss-minimizing Output? Explain. What economic profit or loss will the
Falak Reply
what is money
DAVY Reply
money is any asset that is generally acceptable for the exchange of goods and for the settlement of debts
Mnoko
what is economic
Stephen Reply
economics is the study of ways in which people use resources to satisfy their wants
Falak
what is Price mechanism
Dhany Reply
what is Economics
ERNESTINA
The study of resource allocation,distribution and consumption.
Emelyn
introduction to economics
Uday Reply
welfare definition of economics
Uday
examine the wealth and welfare definitions of economics
Uday
read book by ml jhingan
Anand
What do we mean by Asian tigers
Aeesha Reply
Dm me I will tell u
Shailendra
Hi
Aeesha
hi
Pixel
What is Average revenue
KEMZO
How are u doing
KEMZO
it is so fantastic
metasebia
uday
Uday
it is a group of 4 countries named Singapore, South Korea, Taiwan and Hong Kong because their economies are growing very faster
Anand
fyn
EDWARD
Please, average revenue is an amount of money you gained after deducted your total expenditure from your total income.
EDWARD
what's a demand
Edward Reply
it is the quantity of commodities that consumers are willing and able to purchase at particular prices and at a given time
Munanag
quantity of commodities dgat consumers are willing to pat at particular price
Omed
demand depends upon 2 things 1wish to buy 2 have purchasing power of that deserving commodity except any from both can't be said demand.
Bashir
Demand is a various quantity of a commodities that a consumer is willing and able to buy at a particular price within a given period of time. All other things been equal.
Vedzi
State the law of demand
Vedzi
The desire to get something is called demand.
Mahabuba
what is the use of something should pay for its opportunity foregone to indicate?
Random Reply
Why in monopoly does the firm maximize profits when its marginal revenue equals marginal cost
astrid Reply
Researchers demonstrated that the hippocampus functions in memory processing by creating lesions in the hippocampi of rats, which resulted in ________.
Mapo Reply
The formulation of new memories is sometimes called ________, and the process of bringing up old memories is called ________.
Mapo Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play




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