Java Reference
In-Depth Information
3. When all the opening element tags, closing element tags, and other markup are
applied consistently in a document, what adjective describes the document?
a. Validating
b. Parsable
c. Well-formed
Answers
1. c. One version, RSS 2.0, claims Really Simple Syndication as its name. The other,
RSS 1.0, claims RDF Site Summary.
2. a. Answers b. and c. both work successfully. One adds the contents of a Text ele-
ment as the element's character data. The other adds the string.
3. c. For data to be considered XML, it must be well-formed.
Certification Practice
The following question is the kind of thing you could expect to be asked on a Java pro-
gramming certification test. Answer it without looking at today's material or using the
Java compiler to test the code.
Given:
public class NameDirectory {
String[] names;
int nameCount;
public NameDirectory() {
names = new String[20];
nameCount = 0;
}
public void addName(String newName) {
if (nameCount < 20)
// answer goes here
}
}
Search WWH ::




Custom Search