Owl Teach Yourself Java in 24 Hours, Fifth Edition
HOME / FEEDBACK / ORDER THE BOOK / OTHER BOOKS / PREVIOUS HOUR / NEXT HOUR / THANKS
ROGERS CADENHEAD

Hour 21: Reading and Writing XML Data

Online Interactive Learning Lab

How to create the Aggregator application.

Hour 21 Quiz

Question 1. Which of the following terms should not be used to compliment XML data that is properly formatted?

1.a. This data is well-formed

1.b. This data is valid

1.c. This data is dy-no-mite!

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.

Question 2. What method reads all the elements that are enclosed within a parent element?

2.a. get()

2.b. getChildElements()

2.c. getFirstChildElement()

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

Question 3. What methods of the Elements class can be used to determine the number of elements that it contains?

3.a. count()

3.b. length()

3.c. size()

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

Notes and Corrections

  • None.

Source Files

Reader Questions

  • None.

Activities

   
HOME / FEEDBACK / ORDER THE BOOK / OTHER BOOKS / PREVIOUS HOUR / NEXT HOUR / THANKS

Search terms used to find this page: Java programming, teach yourself, 24 hours, how to, learn, Sams, Macmillan, Java2, JDK1.5, Java 1.5, JDK 1.5, SDK1.5, Java 2 SDK 1.5, SDK 1.5, Java 2 version 1.5, J2SE 1.5, J2SE 5, Java 2 Standard Edition 1.5, Java 2 Standard Edition 5, Java 2 SDK, Java SDK, Rogers Cadenhead, tutorial, hands-on, source code, code, javac, java, appletviewer, help, learning, applet, application, Java Plug-in, plugin, Swing, GUI, interface, Java2D, IO, Java Web Start, games, novice, beginner, neophyte, rookie

Valid HTML 4.01!

Valid CSS!