<< Chapter < Page | Chapter >> Page > |
Revised: Fri Jun 03 17:21:17 CDT 2016
This page is included in the following Books:
This is a page from the book titled The json-simple Java Library . The book explains how to use the json-simple Java library to generate, transform, and query JSON text. This page provides review questionsand answers for the page titled Json0210: Structure of the json-simple Java Library . Once you study that page, you should be able to answer the review questions in this page.
The questions and the answers in this page are connected by hyperlinks to make it easy for you to navigate from the question to the answer and back again.
True or False? Version 1.1 of the json-simple Java library contains the following packages:
True or False? Version 1.1 of the json-simple Java library contains the public classes shown below
True or False? Version 1.1 of the json-simple Java library contains a class named Yylex in the org.json.simple.parser package that is declared to be package-private .
True or False? Despite its name, the JSONArray class is not really an array. Instead, it is a List .
True or False? Objects of the JSONArray class contain unordered data.
True or False? Other than the JSONObject class and the JSONArray class, all of the classes in version 1.1 of the json-simple Java library extend the Object class.
True or False? The JSONObject class extends the standard Java TreeSet class.
True or False? An object of the JSONObject class maps keys or names to values .
True or False? An object of the JSONObject class can contain duplicate keys but cannot contain duplicate values.
True or False? An object of the JSONObject class is an unordered collection.
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.
True. An object of the JSONObject class extends the HashMap class and implements the Map interface. According to the Oracle documentation, "The order of a map is defined as the order in which the iterators on the map's collection views return theirelements. Some map implementations, like the TreeMap class, make specific guarantees as to their order; others, like the HashMap class, do not."
False. The JSONObject class implements the Map interface. According to the Oracle documentation, "A map cannot contain duplicate keys; each key can map to at most one value."
True. JSON documentation often speaks of name/value pairs. However, the JSONObject class extends the standard Java HashMap class, which implements the Map interface. According to the Oracle Java documentation, an object that implements the Map interface is "An object that maps keys to values." Therefore, it is probably acceptable to use the terms name/value and key/value interchangeably.
False. The JSONObject class extends the standard Java HashMap class.
True.
False. Because the JSONArray class extends the ArrayList class, which implementsthe List interface, it is "An ordered collection (also known as a sequence). The user of this interface has precise control over where in the list each element is inserted. The user can access elements by their integer index (position in the list), and search for elements in the list."
True. The JSONArray class extends the standard ArrayList class, which implements the List interface.
True.
False. Version 1.1 of the json-simple Java library does not contain a class named Object .
True.
This section contains a variety of miscellaneous information.
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-
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?