Previous Section  < Day Day Up >  Next Section


To see whether you took a big enough byte from the tree of knowledge during this hour, answer the following questions about input and output streams in Java.



Which of the following terms should not be used to complement XML data that is properly formatted?

  1. This data is well-formed.

  2. This data is valid.

  3. This data is dy-no-mite!


What method reads all of the elements that are enclosed within a parent element?

  1. get()

  2. getChildElements()

  3. getFirstChildElement()


What method of the Elements class can be used to determine the number of elements that it contains?

  1. count()

  2. length()

  3. size()



c. Well-formed data has properly structured start and end tags, a single root element containing all child elements, and an ?XML declaration at the top. Valid data follows the rules of a particular XML dialect. "Dy-no-mite!" is the catchphrase of the comedian Jimmie "J.J." Walker.


b. The getChildElements() method returns an Elements object holding all of the elements.


c. Just like vectors, Elements uses a size() method that provides a count of the items it holds.

    Previous Section  < Day Day Up >  Next Section